Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve display of alerts in /alerts #1371

Open
grobie opened this Issue Feb 4, 2016 · 9 comments

Comments

Projects
None yet
7 participants
@grobie
Copy link
Member

grobie commented Feb 4, 2016

The alerts on /alerts are currently ordered by their order in the rule files. As rule file names are not visible in that table, the order appears to be random. One way would be to sort all alerts alphabetically.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Feb 4, 2016

...or alternatively, group them by rule file. This could be better because thematically related alerts that are not necessarily alphabetically adjacent will stay grouped together.

@grobie grobie changed the title Sort /alerts alphabetically Improve display of alerts in /alerts Feb 4, 2016

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Feb 4, 2016

By rule group would make the most sense, once we have those.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Feb 4, 2016

@brian-brazil Since rule groups cannot span files, it could even be nested. File -> Group.

@pbhudiaBAE

This comment has been minimized.

Copy link

pbhudiaBAE commented Feb 26, 2019

I can have a look into this

@pbhudiaBAE

This comment has been minimized.

Copy link

pbhudiaBAE commented Apr 5, 2019

alerts

I know this feature/issue has been mentioned a few times #3579

Here's what I've managed to do so far.
The alerts are grouped by their group name. The group name row isn't a chevron but just the name of the group. When I refresh the page however the Group rows shuffle (I haven't changed/added any code on how alerts within groups should be organised since I am unsure of how it works exactly, it might be a change in web.go).

Here's a link to my branch
https://github.com/BAESystemsAI/prometheus/tree/SortingAlertsv1

Any suggestions/ help would be really appreciated.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Apr 5, 2019

@pbhudiaBAE Looks like a great start! For the group sorting, you see how we use a byAlertStateAndNameSorter to sort alerts - we'd need something similar for the groups in web.go.

@pbhudiaBAE

This comment has been minimized.

Copy link

pbhudiaBAE commented Apr 10, 2019

Screenshots from web.go
webln500 go
webgoln900

@juliusv Thanks. Having trouble sorting the groups. I tried to implement a similar method as to how alerts are grouped but I get the following error:

web/web.go:501:33: cannot use alerts (type *rules.AlertingGroups) as type []*rules.AlertingGroups in field value
web/web.go:503:9: cannot use groupSorter.Groups (type []*rules.AlertingGroups) as type *rules.AlertingGroups in assignment
web/web.go:947:21: invalid operation: s.Groups[i] < s.Groups[j] (operator < not defined on pointer)

I'm fairly new to Go and pointers aren't my strongest suit. Any suggestions/ help would be great :)

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Apr 10, 2019

@pbhudiaBAE No problem, could you file a draft pull request (https://github.blog/2019-02-14-introducing-draft-pull-requests/)? That way it'll be easier to comment and all...

@pbhudiaBAE

This comment has been minimized.

Copy link

pbhudiaBAE commented Apr 10, 2019

@juliusv I've made a draft pull request #5448. Ignore the first one, I accidentally made it open and couldn't make it a draft again. The latest commit failed the tests because it doesn't build due to those pointer issues in web.go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.