avojak / pihole-influxdb-monitor

Export Pi-hole statistics to InfluxDB 2.x
MIT License
24 stars 6 forks source link

Top queries panel in Grafana only showing blocked queries #7

Closed dlmorgan999 closed 6 months ago

dlmorgan999 commented 6 months ago

This container is great - thanks so much for making it available! Having said that, I imported the Grafana dashboard, and it appears (by comparing it to the native Pi-Hole dashboard) that the Total Queries graph is displaying blocked queries, but not permitted queries. I'm going to take a stab at fixing it myself, but I have zero experience with Flux, so I figured I'd post here as well.

Here's a screenshot of the Pi-Hole dashboard:

image

And this is what I'm seeing on the Grafana dashboard:

image
avojak commented 6 months ago

Ah - I think I know what the problem is. Could you go to the menu for the panel and click Edit. Then in query B could you try replacing the pihole-01 with $alias on line 5:

  |> filter(fn: (r) => r["alias"] == "pihole-01")

should be:

  |> filter(fn: (r) => r["alias"] == "$alias")

One of my Pi-holes is named pihole-01, so it looks like I incorrectly created the dashboard template!

This is what I would expect the correct queries to look like:

image
dlmorgan999 commented 6 months ago

Yup - that fixed it. Thanks for the quick response!