Skip to content

Mutable global labels support? #580

@pcholakov

Description

@pcholakov

Hey folks,

We use metrics-exporter-prometheus in network server, and we would like to apply a global label that isn't immediately known on startup. It's useful to us to begin recording metrics immediately, and only add the label once it is known, which could take a second as it requires communicating with a remote service.

In light of this, would you consider making the global labels mutable after the recorder is initialized? I sketched out how this might work here: 7c820d8. I had to carefully splice the new labels into the distributions structure; it worked in my testing but admittedly it wasn't very extensive. Would you consider such a feature? I can open a PR and we can continue the conversation there, if so.

In any event, thanks for an incredibly useful crate!

(Here is the context in which this requirement came up: restatedev/restate#3027)

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