Description
Version 0.5.x of postgres_exporter
enabled support for multi-server connections from a single exporter. This necessitated a need to be able to distinguish different servers on a per metric basis, so the server
label was introduced. However, with our current implementation of pgmonitor, this breaks things in several ways.
Proposed fix is to add a --disable_server_label
flag to the exporter startup to remove this new label.
We do not currently connect to multiple pg clusters from the same exporter, so not having the label doesn't break anything for us and fixes several issues we're encountering:
-
The biggest issue is that the
pg_up
metric does not have this label applied to it. This breaks our Overview dashboard which does some math along with the replication status metric to determine if a system is up and what it's type is (Primary/Replica). Math can only be done between metrics with matching label sets. I've opened an issue on thepostgres_exporter
repo itself about this. Maybe we could see about fixing it ourselves as well in another PR? -
When upgrading the postgres_exporter to 0.5.x and higher, this also causes all graphs to have their line colors changed and puts duplicated entries into the legend. This is because Prometheus presents a metric with a different label set as a unique metric. This also breaks our single panel metric for pgbackrest due to it causes a multi-series error because it's presenting the same named metric twice to a single metric panel.
The second problem above is only really an issue on upgrades, but it means it would be an ongoing issue until the "old" metrics before the upgrade were phased out. The first issue is a problem even on brand new installs.