prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.83k stars 745 forks source link

add client_addr to metric pg_stat_activity_max_tx_duration #986

Open betanummeric opened 11 months ago

betanummeric commented 11 months ago

implements #985

betanummeric commented 11 months ago

@SuperQ I don't think most users have so much more client hosts than postgres-users to make the client_addr-label problematic. But sure, this introduces another factor to the amount of monitoring data. Would it be ok for you to make this change opt-in using a CLI flag?

SuperQ commented 11 months ago

An opt-in flag would be fine. The only issue is that this collector setup hasn't been moved to our new collector package, so it's possibly slightly difficult to implement here.

sysadmind commented 11 months ago

I don't know that we have had a good example of customizing a collector that has been ported to the collector package either. I remember another request noting that the constructors for collectors don't have an obvious pattern for customization. @SuperQ Do we have a good example from another exporter for customizing collectors?