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.
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 wantpg_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.