weaveworks/promrus

Error "duplicate metrics collector registration attempted" on multiple initialisations

Closed this issue · 0 comments

When creating the same hook multiple times, the counter vector for the hook fails to be registered by Prometheus, which then fails with:

error duplicate metrics collector registration attempted

I might be better for promrus to:

  • be able to safely to initialise the hook multiple times (in order to tolerate user errors and/or resets), OR
  • be able to unregister the hook.

Initially raised by @bboreham here:

Please add to the documentation on this function that it cannot be called more than once, or bracket this section with a test to avoid causing an error duplicate metrics collector registration attempted (and adding multiple instances of the same hook below)