-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Public encoding functions? #152
Comments
Thanks for considering this. I'll try it. |
It's definitely a big improvement for my use case. I have to a clone an But it's pretty good so if it's released I'll probably use it instead of my current hacky solution where I'm creating a new registry and register metrics on each scraping. |
I don't see how we can implement As for As for
Glad it can improve your use-case. |
Sometimes I have already e.g.
nodes: Vec<Node>
in the application state whereNode
is like(When you are already working with a
&Node
, bumping the requests counter is just an atomic inc. It's much more efficient thanget_or_create(...).inc()
.)And I'd like to expose the requests counter of all nodes as a metric family. It might be possible with the collector API, but it would still require quite some boxing, cloning and iterator mapping.
Instead I'd like to encode the metrics myself, e.g.:
This will not require any extra allocation or cloning. By fusing the collecting and encoding phase, metrics can be encoded very efficiently.
The text was updated successfully, but these errors were encountered: