prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.81k stars 742 forks source link

one exporter monitor multi pg instance but just return one pg_up metric #347

Open shutao917 opened 4 years ago

shutao917 commented 4 years ago

hi, i run exporter in docker,with DATA_SOURCE_NAME= postgresql://user:password@postgres-single.postgresql:5432/postgres?sslmode=disable,postgresql://user:password@postgres-single-2.postgresql:5432/postgres?sslmode=disable but the exporter just return one "pg_up{} 1" metric exception is: pg_up{server:"postgres-single.postgresql:5432"} 1 pg_up{server:"postgres-single.postgresql-2:5432"} 1

IgorOhrimenko commented 4 years ago

I have the same issue. I checked previous versions and the last one correctly working 0.5.1. On servers with many sources, rolled back to 0.5.1. pg_up is an important metric for a trigger as pg_up != 10.

aamkye commented 4 years ago

Same here, proposed idea about labels in pg_up metrics seems sufficient. @wrouesnel what do You think?

timown commented 4 years ago

Same here, would expect server label here

azhurbilo commented 3 years ago

@SuperQ do you have any plan to support "server" label for pg_up? https://awesome-prometheus-alerts.grep.to/rules#rule-postgresql-1-1 for multi instance availability alert