Skip to content

Commit

Permalink
Merge pull request #969 from prometheus/stn/ui-consistent-alert-sorting
Browse files Browse the repository at this point in the history
Sort alerts by their fingerprint
  • Loading branch information
mxinden authored Sep 6, 2017
2 parents cb9c946 + ad64e9f commit 1007e0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"fmt"
"net/http"
"regexp"
"sort"
"sync"
"time"

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 1007e0f

Please sign in to comment.