Closed peter-lockhart-pub closed 1 month ago
Thanks @peter-lockhart-pub for reaching out. The request is totally valid and I have it already implemented for some other exporters so that metrics are only registered once and can monitor different instances with the same exporter. I will definitely add it, but I'm traveling for a view days so may need a few extra days.
A new release 2.2.0 is now available.
If a project defines multiple
pool
s orclient
s, it cannot use this library to monitor them. For example, more than 1 call tomonitorPgPool
will result in an errorbecause a new
PgPoolPrometheusExporter
is created each time, which defines metrics as properties to that instance.Consider a project that might maintain a
pool
of instances to a DB with write access, and then apool
of instances to a read replica - you would want to monitor these 2 separate pools.This could be resolved by letting a user of the library specify a prefix or inject a string into the name of the metrics? Or changing the metrics to be declared in a central place and then differentiate the metrics of different exporters by a label?