File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,21 @@ def test_prometheus_node_exporter_metrics(prom):
39
39
"""Check that expected node exporter metrics exist."""
40
40
metrics = prom .all_metrics ()
41
41
assert "node_cpu_seconds_total" in metrics
42
+
43
+
44
+ def test_prometheus_alerts_inactive (prom ):
45
+ """Check that no Prometheus alerts are active."""
46
+ # https://prometheus.io/docs/prometheus/latest/querying/api/#alerts
47
+ response = prom ._session .get (
48
+ "{0}/api/v1/alerts" .format (prom .url ),
49
+ verify = prom ._session .verify ,
50
+ headers = prom .headers ,
51
+ auth = prom .auth ,
52
+ cert = prom ._session .cert ,
53
+ )
54
+ assert response .ok
55
+ response = response .json ()
56
+ assert "status" in response
57
+ assert response ["status" ] == "success"
58
+ alerts = response ["data" ]["alerts" ]
59
+ assert not alerts
You can’t perform that action at this time.
0 commit comments