Open sazzer opened 1 year ago
Hitting the same situation with #525. We need to be able to get the registered metric from register
function. The ideal usage is whenever I call register
with legal input, it returns the registered metric, whenever it is just registered, or registered by other call.
I've written some Axum middleware to record the number of times each HTTP request is processed, and I'm hitting problems with actually recording the metrics.
What I've done so far is this:
And the call to
registry.register()
returnsAlreadyReg
on all incoming requests after the first one.Is there some easy way to get back the already registered metric so that I can increment that instead?
I've looked at calling
registry.gather()
to try and find it, but can't trivially work out how to find the correct entry in the returned set.Cheers