postgres_exporter icon indicating copy to clipboard operation
postgres_exporter copied to clipboard

Metrics from multiple RDS instances on different versions not shown

Open urbann3 opened this issue 3 years ago • 1 comments

What did you do? Configured exporter to pull metrics from multiple instances via DATA_SOURCE_NAME environment variable with a comma separated list. All targets are RDS, some of them are on Postgres version 11.x, some on 12.x and 13.x, however looks like the exporter is not happy when I try mixing the versions as no metrics are shown. If I configure the exporter to pull only from database running on version 11.x, it is okay, metrics are shown, same goes for 12.x and 13.x, but not all together. I am not sure if this is expected or not?

What did you expect to see? Metrics, lots of them, from multiple RDS versions :)

What did you see instead? Under which circumstances?

Environment Exporter running in Kubernetes cluster on EKS

  • postgres_exporter version: v0.10.1 v0.11.0 v0.12.0-rc.0

  • PostgreSQL version: 11.x 12.x 13.x

  • Logs: No errors in the logs, it is making successful connection to each database regardless of database version

urbann3 avatar Sep 01 '22 12:09 urbann3

This is unexpected. I did some local testing and I can confirm this problem. I have traced the root cause to the fact that the pg_settings dynamically sets the help text on metrics to the description from the database: https://github.com/prometheus-community/postgres_exporter/blob/ac9fa133027d748818c56d9498f33ec5eaec658b/cmd/postgres_exporter/pg_setting.go#L73

To fix this, we should probably stop dynamically setting the help text from the database. Thanks for the feedback.

sysadmind avatar Sep 02 '22 14:09 sysadmind

We have almost the same issue: three instances are in DATA_SOURCE_NAME, all with version 11. In logs: ts=2022-12-19T15:59:22.837Z caller=collector.go:196 level=error msg="collector failed" name=database duration_seconds=0.01336918 err="pq: permission denied for database rdsadmin"

oleksii-karpenko-rri avatar Dec 19 '22 16:12 oleksii-karpenko-rri