postgres_exporter icon indicating copy to clipboard operation
postgres_exporter copied to clipboard

Describe available metrics

Open PhilipMay opened this issue 3 years ago • 6 comments

A description of the available metrics would be very helpful. Or maybe a link.

Many thanks Philip

PhilipMay avatar Jun 25 '22 19:06 PhilipMay

The trouble with a list like this is that it is hard to keep up to date. Contributors not familiar with the project may not know or forget to add new metrics to the list when submitting a PR. It's an easy item to forget even for maintainers. I'm not opposed to adding one however. I wish there was an easy way to have the code automatically generate this list.

sysadmind avatar Jul 19 '22 23:07 sysadmind

I wish there was an easy way to have the code automatically generate this list.

Why not adding a subcommand? postgres_exporter list_metrics that dumps metrics and descriptions on stdout?

n-rodriguez avatar Aug 18 '22 21:08 n-rodriguez

Basically this : https://github.com/prometheus-community/postgres_exporter/blob/c84fc4a13a414af7af9da3335e5e3e6653b10215/cmd/postgres_exporter/postgres_exporter.go#L165

n-rodriguez avatar Aug 18 '22 21:08 n-rodriguez

@n-rodriguez The reason we can't just dump that map is because it's only part of the metrics that the exporter implements. Many metrics are not part of that map and I haven't found a good way to dump the metrics. A subcommand would need to register the metrics first which would be dependent on cli flags (to enable or disable collectors) and possibly not created before the first scrape.

sysadmind avatar Aug 25 '22 02:08 sysadmind

It could also be nice to link a demo implementation with a public grafana, an exporter with all the collectors enabled and some test database with some non-sensitive data (perhaps some postgresql database used for unit testing in some project?). Then listing all the metrics would only be a matter of a simple PromQL query.

nemobis avatar Nov 29 '23 11:11 nemobis

@nemobis That is something we could try with the Prometheus demo site.

https://github.com/prometheus/demo-site

We're in need of maintainers to keep it running.

SuperQ avatar Nov 29 '23 13:11 SuperQ