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
1 changed files with 4 additions and 0 deletions

View File

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