postgres exporter metrics getting error

435 views
Skip to first unread message

Prashant Singh

unread,
Jun 28, 2023, 6:51:16 AM6/28/23
to Prometheus Users
Dear All,

I have installed postgres exporter on posgres  Master DB server. but I have  getting below error. please sugest , how can solve this.

error .

pg_exporter_last_scrape_error 1
pg_exporter_scrapes_total 256
pg_scrape_collector_duration_seconds{collector="bgwriter"} 0.003357295
pg_scrape_collector_duration_seconds{collector="database"} 0.005279667
pg_scrape_collector_success{collector="bgwriter"} 0
pg_scrape_collector_success{collector="database"} 0
pg_up 0

Thanks,
Prashant 

Julius Volz

unread,
Jun 28, 2023, 9:26:51 AM6/28/23
to Prashant Singh, Prometheus Users
Hi Prashant,

I have not used the Postgres exporter, but judging by the code at https://github.com/prometheus-community/postgres_exporter/blob/dcf498e709b121eb1ff2e193f66c8ff2d4611b58/cmd/postgres_exporter/postgres_exporter.go#L663-L703, the "pg_exporter_last_scrape_error" metric having a value of 1 means that the exporter was unable to connect to the Postgres backend. It also logs the specific error message, so you should be able to see the exact backend connection error reason in your exporter's logs.

Kind regards,
Julius

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/1fdbc0f2-4662-479f-ae8e-d82e0d1037c3n%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com
Reply all
Reply to author
Forward
0 new messages