diff --git a/test/pytest/test_prometheus.py b/test/pytest/test_prometheus.py index 6d9e260b8908f78eeb3515577b14de3248ac962d..05f00bceb1afbf8a40840a015f3a4970d14d2bca 100755 --- a/test/pytest/test_prometheus.py +++ b/test/pytest/test_prometheus.py @@ -4,6 +4,8 @@ import pytest @pytest.mark.prometheus def test_prometheus_alerts(host): + """Test prometheus for firing alerts.""" + def summarize_alerts(alerts): """Print a alert summary.""" print('Total alerts: %s' % len(alerts)) @@ -11,7 +13,11 @@ def test_prometheus_alerts(host): print("Starting prometheus test...") - url = 'http://127.0.0.1:30090/api/v1/alerts' + prometheus_ip = host.check_output( + 'dig +short ' + 'monitoring-prometheus-oper-prometheus.oas.svc.cluster.local ' + '@10.43.0.10') + url = 'http://{0}:9090/api/v1/alerts'.format(prometheus_ip) alert_json = json.loads(host.check_output('curl ' + url)) status = alert_json["status"] alerts = alert_json["data"]["alerts"]