You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Query alertmanager for alerts with the label foo=~"bar|" or foo=~".*"
What did you expect to see?
I expected the alerts with the label foo set to bar and the alerts with foo unset to be returned. This is the behaviour when querying the ALERTS metric through prometheus.
What did you see instead? Under which circumstances?
The alerts with the foo label unset weren't returned for any of the regex matchers (although they were returned for a query like foo="")
This behaviour makes providing dropdown filters for alert labels in Grafana impossible as far as I can tell, as it will always filter out the alerts which don't have that label set.
Environment
System information: Linux 4.4.225-1.el7.elrepo.x86_64 x86_64
Filtering the alert out when the label is missing precludes a
possible match for an empty value. This change allows the
match to be evaluated.
Closesprometheus#2342
Signed-off-by: Victor Araujo <vear91@gmail.com>
* Make filter labels consistent with Prometheus
Filtering the alert out when the label is missing precludes a
possible match for an empty value. This change allows the
match to be evaluated.
Closes#2342
Signed-off-by: Victor Araujo <vear91@gmail.com>
* Add tests for matchFilterLabels in v2 api
Signed-off-by: Victor Araujo <vear91@gmail.com>
What did you do?
Query alertmanager for alerts with the label
foo=~"bar|"
orfoo=~".*"
What did you expect to see?
I expected the alerts with the label foo set to bar and the alerts with foo unset to be returned. This is the behaviour when querying the
ALERTS
metric through prometheus.What did you see instead? Under which circumstances?
The alerts with the foo label unset weren't returned for any of the regex matchers (although they were returned for a query like
foo=""
)This behaviour makes providing dropdown filters for alert labels in Grafana impossible as far as I can tell, as it will always filter out the alerts which don't have that label set.
Environment
Linux 4.4.225-1.el7.elrepo.x86_64 x86_64
0.16.1
2.14.0
The text was updated successfully, but these errors were encountered: