Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a InfluxDB-tag value in a grafana legend?

I have a InfluxDB dataseries. It stores one information about mulitple machines. I distingsh between these machines with a tag. I can display the information for all three machines at once using a "Group by tag(machine)" clause. the name of the legends is "table.derivative {machine: 1}", "table.derivative {machine: 2}" and so on. How can I change it to "machine 1", "machine 2" and so on?

So far I came across this suggesting to use $groupby (or $g ?), but both are just added a literally.

like image 360
Michael K. Avatar asked Feb 22 '17 17:02

Michael K.


People also ask

Does Grafana support InfluxDB?

If you're an InfluxDB Cloud 2 user, Grafana has updated the InfluxDB Data Source to support Flux, without requiring you to separately install a Flux plugin.

Does Grafana support flux?

The power of Flux in GrafanaInfluxData has updated the InfluxDB data source for Grafana, allowing users to query InfluxDB using the Flux query language. This capability is now native in Grafana 7.1; users don't have to install or manage any additional plugins.


1 Answers

In Grafana, you can use alias patterns. There is a description of alias patterns at the bottom of the metrics tab:

enter image description here

In your case, in the Alias By field you would write $tag_machine.

Here is an InfluxDb example on the Grafana demo site that uses the Alias By field:

https://play.grafana.org/d/000000002/influxdb-templated?editPanel=1&orgId=1

like image 100
Daniel Lee Avatar answered Oct 12 '22 06:10

Daniel Lee