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 endpoint exposition format is incorrect: metrics names include a mix of underscores & dots #25

Closed
nikitabugrovsky opened this issue Apr 4, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@nikitabugrovsky
Copy link
Contributor

Describe the bug

Prometheus v2.25.2 is unable to parse data provided by pgexporter /metrics endpoint. Scrape job fails with the following error:
strconv.ParseFloat: parsing ".max": invalid syntax & strconv.ParseFloat: parsing " not": invalid syntax

To Reproduce

Steps to reproduce the behavior.

  1. bin/pgexporter -c /etc/pgexporter/pgexporter.conf -u /etc/pgexporter/pgexporter_users.conf
  2. make sure /metrics endpoint is up & running
  3. Prometheus scrape job should be configured as follows:
- job_name: database-http-metrics
  honor_timestamps: true
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets:
    - <some_host>
    labels:
      env: stage

Version

What is the version of pgexporter ?

pgexporter 0.2.0

Prometheus

Can you provide the output of the invalid Prometheus metrics ?

Sample output:

#HELP pgexporter_pg_settings_pg_stat_statements.max Sets the maximum number of statements tracked by pg_stat_statements.
#TYPE pgexporter_pg_settings_pg_stat_statements.max gauge
pgexporter_pg_settings_pg_stat_statements.max{server="primary"} 5000
pgexporter_pg_settings_pg_stat_statements.max{server="replica"} 5000
pgexporter_pg_settings_pg_stat_statements.max{server="cascade"} 5000
@nikitabugrovsky nikitabugrovsky added the bug Something isn't working label Apr 4, 2022
@jesperpedersen
Copy link
Contributor

You will need to replace '.' with '_' in the keys

nikitabugrovsky added a commit to nikitabugrovsky/pgexporter that referenced this issue Apr 10, 2022
nikitabugrovsky added a commit to nikitabugrovsky/pgexporter that referenced this issue Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants