postgres exporter custom query

1,670 views
Skip to first unread message

Adrien

unread,
Mar 30, 2021, 8:19:32 AM3/30/21
to Prometheus Users
Hi,

I need to export the result of a postgres select query, I tried to use a postgres exporter (https://github.com/prometheus-community/postgres_exporter) but there is a glitch: it seems there is no way to run custom queries on specific database: they are ran on every db, leading to errors in logs, there is an enhancement request about that. (https://github.com/prometheus-community/postgres_exporter/issues/443
Does someone have an idea how to workaround this ?

Thanks

Ben Kochie

unread,
Mar 30, 2021, 8:53:36 AM3/30/21
to Adrien, Prometheus Users
I would recommend using the SQL exporter. The postgres_exporter is meant to provide metrics about the PostgreSQL server, not the data in databases.


--
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/3c6e79f3-1a05-44b0-9fff-f905d2cdf483n%40googlegroups.com.

Adrien

unread,
Mar 30, 2021, 9:37:41 AM3/30/21
to Prometheus Users
Thank you, this was also my idea but I wanted to avoid using another exporter for this.

Ben Kochie

unread,
Mar 30, 2021, 9:57:20 AM3/30/21
to Adrien, Prometheus Users
The sql_exporter has a number of features that make it much more suited to producing metrics from business data.

Reply all
Reply to author
Forward
0 new messages