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 Aliaksandr Valialkin
parent 91d0b45537
commit f90f654cf2
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

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
}