-
Notifications
You must be signed in to change notification settings - Fork 711
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
Exporter does not collect metrics from multiple databases #999
Comments
There's also all metrics following this pattern |
What is the update on this? I think deprecating the |
It seems to be because of this logic, which takes only first DSN to instantiate the 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 |
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_stat_database_*
pg_stat_user_tables_*
pg_statio_user_tables_.*
List of metrics without issue:
pg_stat_database_conflicts_confl_*
pg_stat_archiver_*
pg_stat_activity_*
pg_settings_*
pg_stat_bgwriter_*
pg_stat_bgwriter_* metrics has been served without labels at all.
Example:
Environment
k8s cluster
Logs does not contain errors
The text was updated successfully, but these errors were encountered: