Skip to content
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

Combining registries? #73

Closed
vladvasiliu opened this issue Jul 19, 2022 · 4 comments
Closed

Combining registries? #73

vladvasiliu opened this issue Jul 19, 2022 · 4 comments

Comments

@vladvasiliu
Copy link

Is there an elegant way of combining multiple registries in a single encode output?

An example of a use case would be writing an exporter for metrics from an external system, as opposed to the own application's metrics.

The idea is that new metric families would be created and populated on each scrape. But there could also be exporter-related metrics that would be constant between scrapes, such as an info, etc.

One way of doing this right now would be to register the exporter's metrics to a new, per-scrape Registry, together with the scrape metrics and encode that. This approach seems somewhat verbose.

A more ergonomic approach would be for the encode function to take some iterable of Families and encode that, which is basically what the Registry is from its point of view.

@mxinden
Copy link
Member

mxinden commented Jul 22, 2022

Would the Collector pattern be helpful here?

Proposed in #49

Further designed in #29 (comment)

@vladvasiliu
Copy link
Author

Yeah, I think that could be helpful.

I'd initially glossed over these, seeing how at first they were about "custom encoders", but upon closer reading that's pretty much what I'm after.

@mxinden
Copy link
Member

mxinden commented Jul 22, 2022

Great. Note @vladvasiliu that help here is very much appreciated.

@vladvasiliu
Copy link
Author

Sure, I'll see if I can come up with something over the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants