From 816d1143b23e67d80f09139b1f0014bdf80655c9 Mon Sep 17 00:00:00 2001 From: Varac <varac@varac.net> Date: Tue, 7 Jan 2020 16:05:54 +0100 Subject: [PATCH] Query coreDns for prometheus clusterIp --- test/pytest/test_prometheus.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/pytest/test_prometheus.py b/test/pytest/test_prometheus.py index 6d9e260b8..05f00bceb 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"] -- GitLab