Skip to content

Remove redundant postgres exporter custom queries

Clemens Beck requested to merge fix-pg-exporter-replication-metrics into master

What does this MR do?

Remove redundant postgres exporter custom queries

Postgres-exporter 13.0 moved queries from the default queries.yaml to collectors.

The newly implemented collectors conflict with the custom queries.yaml from Omnibus, causing errors like:

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"

Upstream MR: https://github.com/prometheus-community/postgres_exporter/pull/801

Changelog: fixed

The queries were moved in gitlab-exporter 13.0, but the redundancy caused no problems until 13.2, which fixed a bug in the replication collector (https://github.com/prometheus-community/postgres_exporter/pull/854). Now a replication metric is registered, with has a conflicting description with the same metric in the custom queries.yaml.

Related issues

Closes #8164 (closed)

Closes #8112 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • MR title and description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • Latest Merge Result pipeline is green.
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow.

For GitLab team members

If you don't have access to this, the reviewer should trigger these jobs for you during the review process.

  • The manual Trigger:ee-package jobs have a green pipeline running against latest commit.
  • If config/software or config/patches directories are changed, make sure the build-package-on-all-os job within the Trigger:ee-package downstream pipeline succeeded.
  • If you are changing anything SSL related, then the Trigger:package:fips manual job within the Trigger:ee-package downstream pipeline must succeed.
  • If CI configuration is changed, the branch must be pushed to dev.gitlab.org to confirm regular branch builds aren't broken.

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes.
  • Documentation created/updated.
  • Tests added.
  • Integration tests added to GitLab QA.
  • Equivalent MR/issue for the GitLab Chart opened.
  • Validate potential values for new configuration settings. Formats such as integer 10, duration 10s, URI scheme://user:passwd@host:port may require quotation or other special handling when rendered in a template and written to a configuration file.

Test Plan

  • start/install the package/container built for this branch
  • verify the metrics can be retrieved as expected
    $ curl 127.0.0.1:9187/metrics
  • verify user stats are disabled by default (for example by inspecting the run script /opt/gitlab/sv/postgres-exporter/run)
  • verify toggling postgres_exporter['flags']['collector.stat_user_tables'] toggled the collector flag
  • verify toggling postgres_exporter['per_table_stats'] takes precedence over postgres_exporter['flags']['collector.stat_user_tables']
Edited by Clemens Beck

Merge request reports