-
Notifications
You must be signed in to change notification settings - Fork 769
Multi-DSN causes duplicate metric errors for built-in stat queries #296
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
Comments
Just noticed that there is also a |
Same problem. The crux of the issue is that auto-discovery doesn't work with anything that produces metrics for multiple databases, including the built-in metrics, the built-in settings and any custom metrics. I changed the for loop at https://github.com/wrouesnel/postgres_exporter/blob/238f5c099af62ec32fb7c511361fd616e3998f2f/cmd/postgres_exporter/postgres_exporter.go#L1315 to be:
So that the built-in stuff is only run for the first discovered database. However, any multi-DB metrics in the extended query has the same problem. I feel there are two real solutions to this problem: |
I make a work around for it. In extended queries (queries.yaml) add current_database() in query, and use it value as a label. SELECT relname, current_database() as datname, ... FROM pg_statio_user_tables So, i have one pg_exporter for default metrics and settings, and another one for extended queries to databases. Last one starts with --disable-default-metrics --disable-settings-metrics --auto-discover-databases flags. So far so good on 0.5.1 |
So, the workaround is to have 2 exporters? Better than a 1<>1 ration to databases I guess. |
We're seeing the same issue. Is this commit related? deac1c3 |
This should be resolved now in 0.8.0 since multi-DSN support has had a bunch of work since then. |
Thanks, I can confirm that I don't see errors on the |
I've just experienced this issue with AWS RDS Aurora PostgreSQL. I have one writer and two readers on my cluster. Pointing to a specific reader endpoint or the cluster read only endpoint instead of the cluster read/write endpoint killed the errors for me. That's not great though, because it seems i'm only getting EDIT: Figured it out: my |
Just experienced issue when having 2 DSNs. Separately they work fine.
Happens both on "v0.8.0" and "latest". |
Been trying to get Multi-DSN working with 0.5.1, but not having much luck. Was getting these errors when running it as a systemd service in CentOS, but also still getting exact same thing when running directly either with socket
or tcp
The built in metrics are causing tons of dupe metric errors because there's no label to distinguish them between multiple databases
Disabling built-in metrics does not help with this either since it does the same thing with the
pg_settings
stuff that's always outputAm I missing something here?
The text was updated successfully, but these errors were encountered: