Merge pull request #969 from prometheus/stn/ui-consistent-alert-sorting

Sort alerts by their fingerprint
This commit is contained in:
Max Inden 2017-09-06 10:10:39 +02:00 committed by GitHub
commit 1007e0ff9e

View File

@ -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)
} }