-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Table Size from Exporter #1036
Comments
Hi @mowirth, I needed such functionality, so I made a workaround for this without waiting. I hope you will find it useful. 1st, create a function in PostgreSQL:
You have to load a dblink extention for that:
Create permission for postgres_exporter user to execute this function:
Try to execute:
If all works as expected - add the call to the /etc/prometheus/postgres_exporter_queries.yaml:
Do not forget to modify your pg_hba.conf to allow postgres_exporter to connect. F.ex.:
|
Does it have to be done with an extension and function? |
Proposal
We want to monitor database sizes over Prometheus to detect if tables are running full.
However, this metric is not (yet ;)) exported by this exporter.
PostgreSQL has different metrics for measuring table size, from indexes, relations and total_relations.
It should be possible to query these metrics with Prometheus, to setup alerts when a table is getting too large (notifying operators to take action) or to take storage consumption at all into consideration.
The text was updated successfully, but these errors were encountered: