vmalert: sort groups at /alerts page (#2968)

Sorting will produce deterministic output
of grops on the page.

Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
Roman Khavronenko 2022-08-09 09:51:29 +02:00 committed by GitHub
parent ad00f4aaaa
commit ef095a9350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -251,6 +251,9 @@ func (rh *requestHandler) groupAlerts() []GroupAlerts {
})
}
}
sort.Slice(groupAlerts, func(i, j int) bool {
return groupAlerts[i].Group.Name < groupAlerts[j].Group.Name
})
return groupAlerts
}