prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.81k stars 740 forks source link

Suggest adding functions to exclude some metrics #1031

Open rus-99-pk opened 6 months ago

rus-99-pk commented 6 months ago

Hello!

Proposal

I suggest adding functions to exclude some metrics in postgres_exporter.

Because I have a large number of sessions and queries in the database, so this number is showed in the form of metrics. Due to the large number of metrics, the third-party application that receives these metrics freezes.

To avoid this, it is necessary to disable a number of metrics, for example pg_stat_activity_count.

I think it will be useful, because i didn't find this in standart functionality.

SuperQ commented 6 months ago

This comes from the old builtinMetricMaps in cmd/postgres_exporter/postgres_exporter.go. This is on the TODO list to be migrated to the collector package. This will enable it to be

Due to the large number of metrics, the third-party application that receives these metrics freezes.

This sounds like a bug, Prometheus should not "freeze" when ingesting data. There are also scrape sample limits in the configuration to help avoid problems like this.

rus-99-pk commented 6 months ago

@SuperQ, thank you!

This sounds like a bug, Prometheus should not "freeze" when ingesting data. There are also scrape sample limits in the configuration to help avoid problems like this.

Yes, Prometheus doesn't freeze. I talked about my third-party application, that receives these metrics from Prometheus.

This comes from the old builtinMetricMaps in cmd/postgres_exporter/postgres_exporter.go. This is on the TODO list to be migrated to the collector package. This will enable it to be

I understand correctly, that it will realized in the future, or not? If is it right, than when will it happen?