lstn / misc-grafana-dashboards

Misc collection of grafana dashboards used to visualize Prometheus metrics for Kubernetes Cluster
Apache License 2.0
86 stars 25 forks source link

Postgre dashboard shows too many instances #5

Closed DaveOHenry closed 3 years ago

DaveOHenry commented 4 years ago

When many pods that expose metrics are deployed it is quite a mess to find the correct one. I think it has to do with the "Instance" variable in the dashboard. The query filters for all instances that have an "up" metric as far as I can tell. Unfortunately there can be many instances that have a metric with this name. Is it possible to just use "pg_up" instead of "up"?

martbhell commented 3 years ago

I got around this by changing the $instance variable to use this regular expression (which only returns instances for exporters with port 9187 and this works for us because we use port 9187 everywhere for this postgresql exporter, I don't know if it's common to run exporters on other ports so not sure ):

/.*instance="([^"]+.*9187)/

Anyway I made a PR here #8 with a proposal to fix it and hard code to only show instances behind port 9187