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

Metric ordering and wildcards #1218

Closed
tulanian opened this issue Dec 11, 2014 · 16 comments
Closed

Metric ordering and wildcards #1218

tulanian opened this issue Dec 11, 2014 · 16 comments
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc

Comments

@tulanian
Copy link

The ordering of metrics in the legend when using wildcards and aliasByNode seems to be random in v1.9.0. Is this a bug or am I missing a setting somewhere?

@kipanshi
Copy link

+1, I was wondering why it's random, probably here someone needs to do a pull request to
do the ordering in Javascript.

@torkelo
Copy link
Member

torkelo commented Dec 11, 2014

What backend (graphite or influx) are you using? The order is determined by the backend time series store. Graphite and Influx is for more returning ordered series.

@torkelo torkelo added the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Dec 11, 2014
@kipanshi
Copy link

I'm using Influxdb 0.8.6.

@torkelo
Copy link
Member

torkelo commented Dec 11, 2014

Might be a bug in influxdb, strange. Gonna check what version I use

@kipanshi
Copy link

What I do is I have a query that fetches count(value) and groups by url,
and then I select "table", "values", "total", "max" checkboxes in the "Axes & Grid"
menu. The legend is a nice table with urls and respective counts,
but the ordering is kinda random,
and I want this table to be sorted by the "total" count, for example.

@tulanian
Copy link
Author

The backend is graphite. Found it! I don't remember seeing sortByName, sortByMinima, etc. under Special> before. sortByName does the trick. When were they added? And what is the default?

@torkelo
Copy link
Member

torkelo commented Dec 12, 2014

The default should be series name, not sure how graphite handles this.

@torkelo torkelo closed this as completed Dec 12, 2014
@tulanian
Copy link
Author

Something changed but I'm not sure when. I don't want to have to add sortByName to every metric with a wildcard. I have side-by-side graphs and each one has a different order for the same aliases: eagle1, eagle2, eagle3; eagle2, eagle1, eagle3; etc. This makes comparisons very difficult.

@torkelo
Copy link
Member

torkelo commented Dec 12, 2014

That sounds very strange, I have always gotten the same order with aliasByNode (sorted in alpha numeric ascending order)

@tulanian
Copy link
Author

image

@torkelo
Copy link
Member

torkelo commented Dec 12, 2014

And this order is different some times? Not sure what causes this. Maybe a bug in graphite.

@tulanian
Copy link
Author

Yup. And it does look like a bug in graphite. Will poke around there.

image

@jfischoff
Copy link

I'm also have this bug with graphite. Has there been any progress?

@cout
Copy link

cout commented Oct 15, 2015

I've noticed that with graphite 0.9.10, there is a well-defined order to the metrics that are returned (I think they are sorted lexicographically by name?). And if I want to enforce a specific ordering with the wildcards, I can explicitly list them, e.g. for cpu usage I can write cpu-{user,system,idle} to ensure that idle is always at the top.

However, when I query against latest graphite master, the metrics come back in a different order every time I query, so I have to add sortByName to any query involving wildcards. Additionally, the above trick to enforce a specific ordering no longer works. So this does appear to be a change in behavior in graphite, and may in fact be a bug.

What I typically want isn't a pure lexicographic ordering but rather a numeric ordering; e.g. if I have eagle1, eagle2, eagle3, ... eagle14, eagle15, then a pure lexicographic ordering would put eagle11..eagle15 between eagle1 and eagle2. This can be implemented as a custom function in graphite, though as pointed out above, this requires adding a call to that function to any queries which use wildcards. I almost wonder if the ordering should be controlled as a display style rather than relying on graphite to do the sorting.

@torkelo
Copy link
Member

torkelo commented Oct 15, 2015

@cout you should report that to the graphite project

@zeph
Copy link

zeph commented May 2, 2016

with natural=True should do the job... but seems not work, I'm looking into it

FAIL... there is a mismatch between the graphite-web and the graphite-api project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc
Projects
None yet
Development

No branches or pull requests

6 participants