Page MenuHomePhabricator

cloud: prometheus: investigate weirdness with metrics and alertmanager
Closed, ResolvedPublic

Assigned To
Authored By
• aborrero
Sep 12 2024, 9:35 AM
Referenced Files
F58618852: image.png
Mar 6 2025, 11:46 AM
F58618848: image.png
Mar 6 2025, 11:46 AM
F57502441: image.png
Sep 12 2024, 9:41 AM
F57502431: image.png
Sep 12 2024, 9:41 AM
F57502387: image.png
Sep 12 2024, 9:35 AM
F57502381: image.png
Sep 12 2024, 9:35 AM
F57502365: image.png
Sep 12 2024, 9:35 AM
F57502361: image.png
Sep 12 2024, 9:35 AM

Description

We have detected a number of cases in which prometheus metrics seems to disappear for no apparent reason, thus causing bogus alerts.

Some examples:

  1. the CephClusterInUnknown alert uses this:

expr: (ceph_health_status{job="ceph_eqiad"} or on() vector(-1)) == -1

In grafana we can see this:

Base metric:

image.png (1,354×1,251 px, 109 KB)

Alert: (I interpret 'no data' as: there should be no alert)

image.png (1,132×800 px, 66 KB)

However, the alert is firing in alertmanager:

image.png (542×245 px, 38 KB)

  1. the OpenstackAPIResponse alert uses this:

expr: avg_over_time((haproxy_server_total_time_average_seconds{job="cloudlb-haproxy", proxy!~"(mysql|wikireplica-db-(web|analytics)-s\\d)"} OR on() vector(100))[12h:]) > 99

In grafana we see this:

Base metric:

image.png (1,601×1,022 px, 304 KB)

Alert expression: (again, I interpret 'no data' as there should be no alert triggering)

image.png (1,625×942 px, 90 KB)

However, the alert is showing in alertmanager:

image.png (1,059×224 px, 46 KB)

  1. The Neutron alerts reported in T374513: Lint problems for NeutronAgentDownForLong and NeutronAgentDown and T373878: openstack: fix missing prometheus metrics

Apparently, same behavior as with the other two.

Event Timeline

From my investigation so far on IRC:

09:51  <godog> so far I have more questions than answers :( both prometheus1005 
               and prometheus1006 report CephClusterInUnknown as not firing, 
               yet didn't send the recovery according to the logs dashboard
09:52  <godog> https://logstash.wikimedia.org/goto/c498d70834ca930e2b6561e1e73b5be9
09:52  <godog> for example: why is this happening? unclear at this time

We had this alert today:

image.png (555×360 px, 55 KB)

Thanos does not know about the metric:

image.png (754×401 px, 39 KB)

Available Neutron metrics can be seen with

cloudcontrol1007:~$ curl http://localhost:12345/metrics

openstack_neutron_agent_state does not exist anymore, maybe we could use openstack_neutron_up?

fnegri claimed this task.

I have reopened T373878: openstack: fix missing prometheus metrics which is more specifically about the current issue (AlertLintProblem alerts due to missing metrics).

I think the behavior detailed in the description of this task (Ceph.* or OpenStack.* alerts firing incorrectly) is not happening anymore, I will resolve this task for now.