You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
I am aware of how to add threshold in Grafana Dashboard in the viz options but I'm exploring a different way to visualize the threshold values using influxdb tags as part of the measurement. This was briefly mentionned in a session from InfluxDays 2020 that it is possible towards the end. Below is what I tried using grafana 7.1 beta with the out of the box influxdb datasource with Flux configured.
Im currently trying out sending threshold values as tags from telegraf to influxdb as below for cpu usage.
# Read metrics about cpu usage
[[inputs.cpu]]
## Whether to report per-cpu stats or not
percpu = true
...
# threshold
[inputs.cpu.tags]
warning = "80"
error = "85"
critical = "90"
Then, in grafana, the influxql query would get the tags values for those threshold tags. Grafana is able to graph those threshold tags if I drop aggregate functions from the query.
SELECT usage_user, usage_system, usage_softirq, usage_steal, usage_nice, usage_irq, usage_iowait, usage_guest, usage_guest_nice, critical, error, warning FROM "cpu" WHERE "host" =~ /$server$/ and cpu = 'cpu-total' AND $timeFilter GROUP BY host
Below a screenshot of how it is rendered.
Showing the same using table:
Now, I tried to do the same with Flux, but it does not graph them as expected. I dont think we can force Grafana to tell it to graph tags values as it could be any string but in this case we are passing digits in string format.
The query is able to get threshold tags value for sure as show below.
I saw a transform that convert labels to fields but that only seem to work for table format. Is it not possible to have this working for graph format if the tags values are numbers?
Finally, I was trying to use another transform "Add Field from calculation" to see if I could tell it to use tag values insteaf of field values, but the transform only expect field or hardcoded number as below. Is it possible to have it working with tags values?
Thanks.
The text was updated successfully, but these errors were encountered:
interesting -- I don't know flux well enough to help on the query...
The issue is that labels in influx are always strings, and the query structure you have returns them as a series. If you rewrite the query so that it is a table and the threshold values are numbers, they should graph like another series
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I am aware of how to add threshold in Grafana Dashboard in the viz options but I'm exploring a different way to visualize the threshold values using influxdb tags as part of the measurement. This was briefly mentionned in a session from InfluxDays 2020 that it is possible towards the end. Below is what I tried using grafana 7.1 beta with the out of the box influxdb datasource with Flux configured.
Im currently trying out sending threshold values as tags from telegraf to influxdb as below for cpu usage.
Then, in grafana, the influxql query would get the tags values for those threshold tags. Grafana is able to graph those threshold tags if I drop aggregate functions from the query.
Below a screenshot of how it is rendered.
Showing the same using table:
Now, I tried to do the same with Flux, but it does not graph them as expected. I dont think we can force Grafana to tell it to graph tags values as it could be any string but in this case we are passing digits in string format.
The query is able to get threshold tags value for sure as show below.
I saw a transform that convert labels to fields but that only seem to work for table format. Is it not possible to have this working for graph format if the tags values are numbers?
Finally, I was trying to use another transform "Add Field from calculation" to see if I could tell it to use tag values insteaf of field values, but the transform only expect field or hardcoded number as below. Is it possible to have it working with tags values?
Thanks.
The text was updated successfully, but these errors were encountered: