Skip to content

Error "duplicate metrics collector registration attempted" on multiple initialisations #5

@marccarre

Description

@marccarre

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions