Closed arajkumar closed 1 year ago
I will move this to upstream postgres_exporter once I find the root cause.
The query which lists database along with it's size takes the time.
SELECT pg_database.datname
,pg_database_size(pg_database.datname)
FROM pg_database;
Looks like the large database is the culprit.
SELECT pg_database.datname
,pg_database_size(pg_database.datname)
FROM pg_database;
datname | pg_database_size
-----------+------------------
postgres | 1284355875619
template1 | 10265091
template0 | 8602115
SELECT pg_database_size('postgres')
takes a lot of time(~5mins) to complete. Probably we should have an option to disable db size population from the exporter?
I see that there is an option collector.database
to disable it, but that doesn't seem to work!
--no-collector.database should fix the problem
@paulfantom May be we should consider bringing the change to cloud as well. CC: @cevian
What happened?
$title
Did you expect to see something different?
postgres_exporter /metrics page must return data quickly in few seconds.
How to reproduce it (as minimally and precisely as possible):
Run against large postgres with quite bit of child tables/hyper tables.
Environment
I've been running postgres/timescale for 2 weeks with >5000 hyper tables and quite a bit of data(1.2TiB).
tobs version:
tobs version
Kubernetes version information:
kubectl version
Kubernetes cluster kind:
insert how you created your cluster: kops, bootkube, etc.
postgres_exporter logs
tobs Logs:
Anything else we need to know?: