-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An option to disable the default sorting of Alerts for a group of Alerts #3901
Comments
Hi! 👋 How would you want Alertmanager to sort alerts in such case? Lexicographically by labels? |
By number values, it’s a query of erros counting and the those values are numbers (integers, I think). |
Hi! 👋 I'm not sure what you mean by number values? Alerts in Alertmanager are basically a set of labels, annotations, a start time and an end time. That's the full set of data we can sort with, so we could sort newest alerts first as an alternative, for example. |
Sorry, I used the wrong terms. |
It's not a strict requirement from Alertmanager. But as mentioned, alerts that come from Prometheus need a query that returns some kind of value.
I'm afraid that's not the case. Alerts in Alertmanger are not ordered, and Prometheus does not send them in a deterministic order. In addition, alerts can come from multiple Prometheus servers at the same time (even in the same groups). |
Disabling the default sorting of Alerts in a group of Alerts would be helpful.
I saw old discussions in this repo about features like setting what
label
to use to sort the alerts and the chosen solution to sort alerts by their label values usingjob
andinstance
as main labels (I can see the sorting code here).But I think having the option to disable the default sorting would be good.
For example, my case is I have a Loki query configured as an alert and I already sort the result by values as I want. Still, alertmanager sorts the result by
job
,instance
, and otherlabels
, if we could disable the sorting the result would be the expected one.That option could be enabled by default and disabling would be a configuration.
What do you think?
Thanks for your time.
The text was updated successfully, but these errors were encountered: