Open freneticpony1995 opened 10 months ago
There's also all metrics following this pattern pg_stat_statements_*
are only showing the values for the first datasource.
What is the update on this? I think deprecating the auto-discover-databases
feature without any alternative solution is very disadvantageous.
It seems to be because of this logic, which takes only first DSN to instantiate the collector
.
When I tried to instantiate multiple collectors in a fork I ran into issues with attempts to register multiple metrics. Seems like running an exporter per DB is the workaround for now.
The best way to use one collector for metrics on several postgres instances is to use the multi-target support. We're in the (slow) process of standardizing the code and how the labels are applied.
Thanks for the context @sysadmind! We're looking forward to the new versions with standardized implementation.
Are all the metrics, including the ones defined in the postgres_exporter.go and custom metrics from a YAML file supported by the multi-target support? Or only those from collector
package?
What did you do?
I've started postgres-exporter in my k8s cluster using official prometheus helmchart v5.3.0. I serve connection information to exporter using environmental variable "DATA_SOURCE_NAME" containing connection strings for 23 host with Postgresql 13.
Example:
DATA_SOURCE_NAME=postgresql://username1:PASSWD1@server1:5432/service1db?sslmode=disable,postgresql://username1:PASSWD2@server2:5432/service2db?sslmode=disable ... etc
What did you expect to see?
I expected to see labels "datname" and "server" in all metrics on /metrics endpoint + all enabled metrics for all databases.
Example:
What did you see instead? Under which circumstances?
I see some metrics has been exported only for 1 database (first in DATA_SOURCE_NAME list) without label "server" or even without any label.
Example:
List of metrics with this issue: pg_database_size_bytes pg_locks_count pg_statdatabase pg_stat_usertables pg_statio_usertables.*
List of metrics without issue: pg_stat_database_conflictsconfl pg_statarchiver pg_statactivity pgsettings pg_statbgwriter*
pg_statbgwriter* metrics has been served without labels at all.
Example:
Environment
k8s cluster