Merge pull request #969 from prometheus/stn/ui-consistent-alert-sorting
Sort alerts by their fingerprint
This commit is contained in:
commit
1007e0ff9e
|
@ -18,6 +18,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -359,6 +360,9 @@ func (api *API) listAlerts(w http.ResponseWriter, r *http.Request) {
|
|||
}, nil)
|
||||
return
|
||||
}
|
||||
sort.Slice(res, func(i, j int) bool {
|
||||
return res[i].Fingerprint < res[j].Fingerprint
|
||||
})
|
||||
respond(w, res)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue