Correct queries, based on template variables #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The PR consists of two parts:
Seq Page Cost
In case, when you provide
kubernetes_namespace
andrelease
labels, you can specify template variables and adjust the vaules on the dashboard. But theSeq Page Cost
metric will be shown incorrectly (see the picture)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:
Template variables narrowing
If you take a look at template variables, you may notice
datname
andmode
variables don't respect other template variables.E.g. you have two PostgreSQL exporters scrapping different databases. If you specificy
namespace
,release
andinstance
, then you expect to see only databases exported by the concrete exporter. However you will still see all databases indatname
filter as well as inmode
.The idea is to make
datname
andmode
dependent onnamespace
,release
andinstance