mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 14:57:40 -08:00
b3a39ccd8a
Right now the /alerts page of Prometheus sorts alerts by severity (firing, pending, inactive). Once multiple alerts have the same severity, their order seems to correlate to how they are placed in the configuration files, but not always. Looking at the code, we make use of sort.Sort(), which is documented not to provide a stable sort. The Less() function also only takes the alert state into account. This change extends the Less() function to provide a lexicographic order on both the alert state and the name. This means I can finally find the alerts I'm looking for without using my browser's search feature. |
||
---|---|---|
.. | ||
api/v1 | ||
ui | ||
federate.go | ||
federate_test.go | ||
web.go | ||
web_test.go |