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

Correct queries, based on template variables #11

Open Kirkirillka opened 2 years ago

Kirkirillka commented 2 years ago

Description

The PR consists of two parts:

Seq Page Cost

In case, when you provide kubernetes_namespace and release labels, you can specify template variables and adjust the vaules on the dashboard. But the Seq Page Cost metric will be shown incorrectly (see the picture)

image

If you take a look at the query for that counter, it:

pg_settings_seq_page_cost

While for others in the row is:

pg_settings_max_wal_size_bytes{instance="$instance"}

Therefore the query must be corrected, like other other counters:

pg_settings_seq_page_cost{instance="$instance"}

Dashboard after the change:

image

Template variables narrowing

If you take a look at template variables, you may notice datname and mode variables don't respect other template variables.

E.g. you have two PostgreSQL exporters scrapping different databases. If you specificy namespace, release and instance, then you expect to see only databases exported by the concrete exporter. However you will still see all databases in datname filter as well as in mode.

The idea is to make datname and mode dependent on namespace, release and instance