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

Target order in Web UI not stable #2536

Closed
Jean-Daniel opened this Issue Mar 28, 2017 · 7 comments

Comments

Projects
None yet
5 participants
@Jean-Daniel
Copy link

Jean-Daniel commented Mar 28, 2017

What did you do?
Reload the target page in the prometheus Web Admin UI

What did you expect to see?
That the order of the target is the same across page reload

What did you see instead? Under which circumstances?
The target are display in random order that vary from one request to the other

Environment
Ubuntu 16.04

  • System information:
    Linux 4.4.0-53-generic x86_64

  • Prometheus version:
    prometheus, version 1.5.1 (branch: master, revision: c4686f7)

@gouthamve

This comment has been minimized.

Copy link
Member

gouthamve commented Mar 28, 2017

@Jean-Daniel

This comment has been minimized.

Copy link
Author

Jean-Daniel commented Mar 28, 2017

Improving readability.

Sometimes, I have to refresh the page to check the status of a target did change from Down to Up, and having to search for the line position after each refresh is a little annoying, especially when the target list become large.

Sorting target by endpoint would also simplify the lookup of a specific target in the list.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 30, 2017

Agreed, having a consistent sort order would be nice for the refresh-and-check use case.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 30, 2017

Actually I'm not sure why it's not sorted already. https://golang.org/pkg/text/template/ says for ranges in templates: "If the value is a map and the keys are of basic type with a defined order ("comparable"), the elements will be visited in sorted key order.". And .TargetPools is a map[string][]*retrieval.Target, and strings are definitely comparable :)

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 30, 2017

Ah of course. The jobs are sorted, but the targets ([]*retrieval.Target) within a job are not. So we just need to sort that slice.

juliusv added a commit that referenced this issue Mar 30, 2017

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 30, 2017

PR out in #2548

juliusv added a commit that referenced this issue Mar 31, 2017

@fabxc fabxc removed the in progress label Mar 31, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

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