Skip to content

Commit e1c6a7d

Browse files
authored
Merge pull request ceph#64385 from rhcs-dashboard/prometheus-http-service-fix
mgr/prometheus: fix metrics service not coming up Reviewed-by: Adam King <[email protected]> Reviewed-by: Redouane Kachach <[email protected]>
2 parents e680d5c + 6a37fc8 commit e1c6a7d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

qa/suites/orch/cephadm/workunits/task/test_monitoring_stack_basic.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ tasks:
6464
curl -s http://${ALERTM_IP}:9093/api/v2/status
6565
curl -s http://${ALERTM_IP}:9093/api/v2/alerts
6666
curl -s http://${ALERTM_IP}:9093/api/v2/alerts | jq -e '.[] | select(.labels | .alertname == "CephMonDown") | .status | .state == "active"'
67+
# check prometheus metrics endpoint is not empty and make sure we can get metrics
68+
METRICS_URL=$(ceph mgr services | jq -r .prometheus)
69+
[ -n "$METRICS_URL" ] || exit 1
70+
curl -s "${METRICS_URL}metrics" | grep -q '^ceph_health_status'

src/pybind/mgr/prometheus/module.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,9 @@ def configure(self, server_addr: str, server_port: int) -> None:
17731773
self.log.exception(f'Failed to setup cephadm based secure monitoring stack: {e}\n',
17741774
'Falling back to default configuration')
17751775

1776+
# In any error fallback to plain http mode
1777+
self.setup_default_config(server_addr, server_port)
1778+
17761779
def setup_default_config(self, server_addr: str, server_port: int) -> None:
17771780
cherrypy.config.update({
17781781
'server.socket_host': server_addr,

0 commit comments

Comments
 (0)