Postgres Exporter reports error when queried
Summary
The postgres exporter reports an error when queried:
$ curl 127.0.0.1:9187/metrics
An error has occurred while serving metrics:
collected metric pg_replication_is_replica gauge:{value:0} has help
"Indicates if the server is a replica" but should have "Indicates if
this host is a slave"
The replication queries have been moved from the default queries.yaml to collectors in gitlab-exporter 13.0 (https://github.com/prometheus-community/postgres_exporter/pull/801). As a result, two is_replica
metrics are defined (one in collector and another in Omnibus's queries.yaml.
This redundancy caused no error until 13.2, which fixed a bug in the replication collector (https://github.com/prometheus-community/postgres_exporter/pull/854). Now that both metrics are registered (under the same name), their different descriptions cause an error.
postgres exporter 13.2 bump: !7058 (merged)
postgres exporter 13.0 bump: !6775 (merged)
Steps to reproduce
- install the nightly image/package with default configuration
- query the postgres exporter
What is the current bug behavior?
No postgres metrics can be queried.
What is the expected correct behavior?
Metrics can be queried.
Relevant logs
Relevant logs
An error has occurred while serving metrics:
collected metric pg_replication_is_replica gauge:{value:0} has help "Indicates if the server is a replica" but should have "Indicates if this host is a slave"
Acceptance Criteria
-
Fix merged (and backported).
If the fix deprecates any flags:
-
Follow-up issue to track removal of deprecated flags created. #8170 (closed) and #8169 (closed) -
Follow-up MR to add the deprecation to the General GitLab deprecations created and merged. gitlab!130072 (merged)