Value Groups/Tags with the InfluxDB/Telegraf Data Source
Value groups/tags behave very differently depending on the Data Source used for the queries. This example is specific for when using the InfluxDB Data Source using Telegraf as the collector.
This example also takes Value groups/tags functionality further by adding a second custom input to the telegraf collector to help group an existing query that contains no useable information that could already be used for grouping.
This example is also specific to my infrastructure, so you will need to group and name your variables and adjust your queries depending on the specifics of your own infrastructure. This is just provided so there may be something that you can get a grasp on easier.
Custom Telegraf Input
1 2 3 4 5 6 7 8 9 10 11 12 13
Interface Variables used in the Dashboard
|Query||SHOW TAG VALUES FROM interface WITH KEY = "ifDescr" WHERE agent_host = '2coin.org'||The main default query that creates all the values that appear in the drop down list.|
|Tags Query||SHOW TAG VALUES FROM containers WITH KEY = "group"||The query that creates all the group names that appear as coloured tags to the right of the drop down list.|
|Tag Values Query||SELECT distinct("value") FROM "containers" WHERE ("group" = '$tag')||The query, that when run, selects all the values in the drop down list.|
You can also add custom tags to your telegraf inputs manually. This helps if you have many InfluxDB data sources, and you want to segregate them further into there own regions or some other tag name that would be useful.
Add the global_tags option to one of your /etc/telegraf/telegraf.conf files.
1 2 3 4 5 6 7 8 9 10 11
Test the telegraf conf is ok,
If no errors detected then
Now open the Grafana UI and explore your data source and you will now have a new option to filter where region = us-east-1