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
Customize legend #58
Comments
Maybe just use "pod_name", "pod_namespace/pod_name" or other tag value will be better |
Yes, that would be nice, the only thing that is bugging me is that the current REST API doesn't return tags with metric data, which means that for each query I would have to perform a second http request to get the tag values of the returned metrics. Or change the REST API. |
Agree, Without change the REST API may need to implement mapping tags API response data to raw/query |
What about some sort of regex? For instance, with OpenShift router metrics and hawkular-openshift-agent I get the following metric:
I have the pod name there in the name, but it gets cut off in the legend because it is too long. Regex could be static and still give me the pod name. |
Would any solution on this issue reach a conclusion in the near future. We would also like to have such a feature with either regex or through use of other tags from the metrics to populate the legend descriptive values. We are using the Hawkular Datasource plugin with metrics collected from OpenShift so have also long and non-usable metric names. |
Wow, it must have changed since the last time I used it. It looks like a prometheus metric name, now. There's definitely some regexp that could be done here. I will have a look when I have some time for it, but in the meantime don't forget that PRs are welcome :-) |
Ok just figured out it's HOSA naming. I'm not so much familiar with it, but any solution would have to be generic enough, not just focused on HOSA. So, I can imagine a "legend" text field where one would type for instance: which would result in: What do you think? |
Customize legend using user-defined regex applied on metric name Ex: from base name "pod/c6e2a9ab-8d1c-11e7-b7be-06415eb17bbf/custom/haproxy_server_bytes_in_total{namespace=my-namespace,pod=web-45-6f464,route=web,server=10.1.10.138:8080,service=web}" Legend: "HAProxy Server Bytes {{namespace=([^,}]+)}} / {{pod=([^,}]+)}}" Would result in: "HAProxy Server Bytes my-namespace / web-45-6f464"
If anyone wants to use before it's released, there's a docker image available with the PR: |
released in 1.1.2 |
Provide a way to display custom legend instead of the metric name, which sometimes is not user-friendly at all.
Allow the use of variables / tags in legend template?
The text was updated successfully, but these errors were encountered: