I’m using the ping plugin with Telegraf and InfluxDB to collect network statistics on my LAN and some external sites. I am currently pinging 7 internal sites, and 1 external site.
I have set up the InfluxDB database, called ‘ping’ to have a ‘realm’ tag for each host, either ‘internal’ for my LAN or ‘external’ for internet sites. Telegraf and InfluxDB are working properly.
I have created a dashboard with 2 variables, realm and targeturl, both have All and multi-value enabled. The query for realm is:
SHOW TAG VALUES FROM "ping" WITH KEY = "realm"
The query for targeturl is:
SHOW TAG VALUES FROM "ping" WITH KEY = "url" WHERE "realm" =~ /^$realm$/
I was able to create a dashboard using the Singlestat visualization that had all entries sorted by url with no difficulty. However, when I wanted to separate the two realms I ran into a minor problem.
The panel query I am using is:
SELECT mean("average_response_ms") FROM "ping" WHERE ("realm" =~ /^$realm$/ AND "url" =~ /^$targeturl$/) AND $timeFilter GROUP BY time($interval) fill(null)
I have the panel set to repeat horizontally, and to use targeturl, which is (mostly) working. For the internal and external rows, I have the row repeat set to use realm and it works. I have 2 rows, but Grafana is doing something strange. Both rows have 8 entries. The internal row has proper values for my 7 internal sites, plus ‘N/A’ for google.com. The external row is the opposite, I have 7 ‘N/A’ values for the internal LAN, and the value for google.com is correct.
Any ideas how I can resolve this?