Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics name conflict overlaps with prometheus-community/postgres_exporter #22

Open
chobostar opened this issue Nov 22, 2024 · 0 comments

Comments

@chobostar
Copy link

The problem

Some metrics provided by https://coroot.com/docs/metric-exporters/pg-agent/metrics, such as pg_up, use the same name as metrics from the https://github.com/prometheus-community/postgres_exporter

It creates obstacles when integrating into existing environments, such as metric collisions in dashboards and alerts.

Possible solutions

Prometheus metric naming conventions suggest that metric names should have unique namespaces to avoid conflicts and maintain clarity when integrating multiple data exporters (refer to the Prometheus Best Practices for Naming ).

To make experience more smooth:

  1. Use different prefix than pg_, e.g. cpg_ ? Like this exporter does https://github.com/CrunchyData/pgmonitor/blob/4abd279d9751b4b3bbffe904aacbecb20e622c80/postgres_exporter/common/queries_global.yml
  2. Support custom prefix/suffix param ? env: CUSTOM_PREFIX=cpg_ ?

Why

This provides greater flexibility for users who may want to:

  • Align metrics with existing naming conventions.
  • Integrate exporter into existing environments without worrying about conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant