postgres_exporter icon indicating copy to clipboard operation
postgres_exporter copied to clipboard

When using multiple DSN, pg_database_size_bytes only return metrics from first DSN

Open rbudiharso opened this issue 2 years ago • 2 comments

What did you do? Install postgres_exporter with multiple postgresql DSN

What did you expect to see? show metric pg_database_size_bytes from all database from all DSN and with server label

What did you see instead? Under which circumstances? Only pg_database_size_bytes from the first DSN in the comma-separated DSN is returned and without server label

Environment

  • System information: Kubernetes 1.28 on AWS EKS

  • postgres_exporter version: prometheus-postgres-exporter-5.1.0 v0.14.0

  • postgres_exporter flags:

  • PostgreSQL version:

    all supported version

  • Logs:

CleanShot 2023-10-16 at 10 12 19@2x

rbudiharso avatar Oct 16 '23 03:10 rbudiharso

I tried switching the DSN around and the problem persist, postgres_expoter only return pg_database_size_bytes from the first DSN

rbudiharso avatar Oct 16 '23 03:10 rbudiharso

I am facing same issue. I also don't see the details on which server the database is running. My second server has an idential database, but bigger in size and I noticed that by moving that server at the start, that size of the database "jumped". Using docker where postgres-exporter is running in with an envronment settings like:

DATA_SOURCE_NAME=postgresql://user:pw@server1:5432/postgres,postgresql://user:pw@server2:5432/postgres,postgresql://user:pw@server3:5432/postgres

petervdb avatar Apr 11 '24 14:04 petervdb