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

Support more wildcards in filters #228

Closed
HerrBerg opened this issue Mar 25, 2014 · 6 comments
Closed

Support more wildcards in filters #228

HerrBerg opened this issue Mar 25, 2014 · 6 comments
Labels

Comments

@HerrBerg
Copy link

For filters please allow all wildcards that are supported by graphite.
These are AFAIK [1]:

  • * (already implemented)
  • ?: select exactly one character
  • [...]: Character list or range
  • {...}: Value list

Additionally the "all" selector should return the filter itself.
This would be very hand for selecting e.g. just the metrics for the disk devices collected without partitions:
Filter DISK: disk-{sd[ab],md?}
Query: host.somehost.[[DISK]].disk_octets.read

[1] http://graphite.readthedocs.org/en/latest/render_api.html#graphing-metrics

@HerrBerg HerrBerg reopened this Mar 25, 2014
@torkelo
Copy link
Member

torkelo commented Mar 25, 2014

This feature request should probably be created for graphite-web. Grafana filters use the /metrics/find/ API in graphite-web to populate filter options. But I think that API supports all the the expression options you list above. So it should work. Did you get an error when you tried the above filter disk-{sd[ab],md?} and remember the query needs to be an absolute metric path, so in your case host.somehost.disk-{sd[ab],md?} might work better.

Regarding the "all" option should use the query instead of just adding all options in a {option1,option2, option3} expression. That is not possible as for example:
filter query: host.somehost.disk-{sd[ab],md?}

Would then be applied to host.somehost.[[DISK]].disk_octets.read as
host.somehost.host.somehost.disk-{sd[ab],md?}.disk_octets.read which would not work so good.

@HerrBerg
Copy link
Author

Today I rechecked with the current version of grafana and a recent version of graphite-web.
I think it is all working now so I close this issue.

@HerrBerg HerrBerg reopened this Apr 16, 2014
@HerrBerg
Copy link
Author

Once more reopened. Now I (re-)found the bug:
The problem occurs when the asterisk is not uses solely between two points. Eg.:
the filter "disk": "host.vm-01.disk-sda_" just returns "host.vm-01.disk-sda{1,2,3,4,a,b}"
but in the render call of the query "host.vm-01.[[disk]].disk_ops.read" the taget "host.vm-01._.disk_ops.read" is send. So in the graph I also see the graphs for sdb, sdc, etc

This is only the case when using the asterisk as wildcard and works perfectly fine with all other wildcards/lists.

@torkelo
Copy link
Member

torkelo commented Apr 16, 2014

yes, if you check the "Include all" checkbox and the query ends with a wildcard the "All" option will be a an asterix as value. I guess I can fix this by checking if the query ends with dot.asterix instead of just wildcard. In that case "All" would be all options in a {option1, option2, etc}

@torkelo torkelo added the bug label Apr 16, 2014
@HerrBerg
Copy link
Author

isn't it possible to just take the wildcard specified in the filter and use it in the target of the query?

@torkelo
Copy link
Member

torkelo commented Apr 16, 2014

@HerrBerg yes, if I parsed out the last segment, that is everything after the last dot, that would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants