mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-16 18:47:10 +00:00
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"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -359,6 +360,9 @@ func (api *API) listAlerts(w http.ResponseWriter, r *http.Request) {
|
|||||||
}, nil)
|
}, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
sort.Slice(res, func(i, j int) bool {
|
||||||
|
return res[i].Fingerprint < res[j].Fingerprint
|
||||||
|
})
|
||||||
respond(w, res)
|
respond(w, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user