-
Notifications
You must be signed in to change notification settings - Fork 27
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
Register lwt pre-collectors and collectors #41
Comments
Could you open a PR with the diff between |
I made a commit with only the changes. I will also make a PR out of it. |
Having async collectors sounds reasonable. However, with effects being added to OCaml 5.0, we really want to remove Lwt from the main prometheus module completely, so I'm nervous about adding a new API knowing we'll be removing it again shortly! With effects, the existing |
Indeed, I understand your concern. In the case of Octez, I'm not sure that we will be able to support OCaml 5.0 in a short term perspective, and Lwt will be a dependency during a while. To me, and as we needed it "rapidly", we have the following options:
|
Do you think that would be possible to add a separate |
I think it's OK to add the lwt collector to the main prometheus library for now. Just be aware that it will likely become deprecated once 5.0 is out, and will disappear a while after that. This library doesn't change much, so having OCaml 4.x stuck on an older release probably won't be a problem. So the plan would be:
|
So is it Ok if I make a PR out of the commit I linked ? |
Yes please :-) |
We are currently exporting metrics from the tezos node.
There are functions that needs to be registered as
pre-collectors
into acollector registry
. Unfortunatly, these functions must return a typeunit Lwt.t
.It would be useful to be able to register such a function.
A proof of concept is avaible on this branch with a use case. The modified version of Prometheus is vendored in
vendors/prometheus
andvendors/prometheus-app
.This poc adds to CollectorRegistry
register_lwt
andregister_pre_collect_lwt
, to register the lwt collectors and pre-collectors, andcollect_lwt
to read the current value of the metrics that have been registered with lwt collectors.The text was updated successfully, but these errors were encountered: