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

Use label values in "Config from query results" #108

Open
rul-hydro opened this issue Oct 12, 2023 · 2 comments
Open

Use label values in "Config from query results" #108

rul-hydro opened this issue Oct 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@rul-hydro
Copy link

It would be so cool if I could write the unit for each metric into a label value and use it directly in a Grafana dashboard instead of setting the unit manually. This could also be used to set the min/max, color, and a ton of other config parameters.

Maybe I'm just stupid, but so far I could not make it work.

@hagen1778 hagen1778 added the enhancement New feature or request label Oct 13, 2023
@hagen1778
Copy link
Contributor

Hi @rul-hydro! According to Prometheus naming convention, the metric's unit should be specified as a suffix. For example, process_cpu_seconds_total means we have a counter (_total) with unit of seconds (_seconds).

I'm not sure if plugin has such a control to automatically apply corresponding unit. Maybe @Loori-R knows

@rul-hydro
Copy link
Author

rul-hydro commented Oct 13, 2023

Hi @hagen1778, thanks for the hint. In my case, the Prometheus naming convention would be difficult to adopt, since I am receiving my metrics from an MQTT source without previous knowledge of the topics and contents.
If I understand correctly, the naming convention is not cast in stone, so I can use metrics names and labels any way that fits my use case. My current plan is to use a dummy metric name that is fixed for all series and put the MQTT topic with all its slashes and special characters into a label. Another optional label would carry the unit.
(A bit off-topic: Does it make a difference to VM whether series are distinct by name or by label? - EDIT since I found out myself: name is just a label that looks different from others, so no technical difference)

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

No branches or pull requests

2 participants