-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make io.prometheus.client.CollectorRegistry.defaultRegistry usable together with iapetos #10
Comments
io.prometheus.client.CollectorRegistry.defaultRegistry
by default?
@delitescere Thanks for reaching out! I do have a problem, though, with implicitly exposing the default registry, since Note to self: |
@xsc excellent idea. |
Yes, the problem is now there's no surface idempotency. I'm using this in a stuartsierra system, so components can be started, stopped, and restarted. As the same registry is being used, the collectors have already been registered. There's no iapetos mechanism for unregistering at the moment. Given I'm using the Prometheus default registry, I can add the following to the "stop" lifecycle task of the component:
This is a little heavy-handed as any collectors my Clojure app doesn't register as part of the "start" lifecycle will be unregistered and not return (although this is not likely in my case). Perhaps the On sum, though, I'm perfectly happy with things as they are. Many thanks! |
These will only work on collectors that were actually registered with a given registry instance.
G'day! This is an awesome library. Thank you so much for making it.
I'm enjoying the ring and jvm wrappers very much. However, I've recently added to my project the InstrumentedAppender but it only has a mechanism for registering its collector with the Prometheus Java client's default registry.
This means that the ring wrapper exposing metrics at
/metrics
doesn't pick up any non-iapetos collectors because a different default registry is created by iapetos.I'm wondering if https://github.com/xsc/iapetos/blob/master/src/iapetos/registry.clj#L79 should be more like:
This keeps the "iapetos_registry" name for the default registry for any existing code that might use it, but uses the underlying Prometheus Java client's default registry.
The text was updated successfully, but these errors were encountered: