Vonng / pg_exporter

Advanced PostgreSQL & Pgbouncer Metrics Exporter for Prometheus
https://pigsty.io
Apache License 2.0
167 stars 44 forks source link

IMPROVEMENT: Respond fake pg_up metrics before planning #4

Closed Vonng closed 3 years ago

Vonng commented 3 years ago

Since Queries (Collectors) are dynamically planned. PgExporter need an alive server to fetch facts.

Which comes into a dilemma: if target PostgreSQL Instance is dead, pg_exporter can not gathering facts thus will abort or wait target online according to config parameter. But sometimes we may want pg_exporter report the situation that target postgres instance is down.

There's a work around: Create a dummy server before PgExporter is waiting dead server online (responding with constant pg_up{} 0). And destroy that server after PgExporter successfully connecting to target server.

Vonng commented 3 years ago

fixed in v0.3.0