Skip to content
Snippets Groups Projects
Verified Commit 816d1143 authored by Varac's avatar Varac
Browse files

Query coreDns for prometheus clusterIp

parent 29e9d7a1
No related branches found
No related tags found
No related merge requests found
......@@ -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"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment