Skip to content

*.: Add a way to ensure all created metrics are properly registered in Prometheus Registry. #2102

@bwplotka

Description

@bwplotka

We have lot's of issue recently when we add metric, instrument and it's not actually registered 🤦‍♂️ e.g #2100

That's enough. I am looking on a mandatory way to test if ALL metrics are actually registered when you start Thanos binary.

Some ideas:
A) Mandatory unit test for all Metrics structs with Registerer that checks what was registered.

  • More automated?
    B) Grep for all metrics creations and check e2e tests if /metrics shows them (kind of primitive)
    C) New** methods for Prometheus client that registers metrics in custom registery
    D) Wrap prometheus client library with something that allows checking if New* method that creates metrics has the corresponding metrics in Registered. (weird)

Any hints on how to do it, @brian-brazil @beorn7 @brancz ? I think C makes sense the most + add item to CONTRIBUTING.md

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions