On 18.08.21 06:23, afridi wrote:
>
> *// below code somewhere in the main func*
> *prometheus.NewRegistry().MustRegister(collectors.NewDBStatsCollector(db.GetConnection(),
> "postgres"))*
You must also expose the metrics registered with your new registry. If
you do it like above, you don't have a handle to the registry and
cannot expose it.
You should register the DBStatsCollector with the same registry you
use for all your other metrics. If that's the default registry, just
write
prometheus.MustRegister(collectors.NewDBStatsCollector(db.GetConnection(), "postgres"))
--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email]
bjo...@rabenste.in