-
Notifications
You must be signed in to change notification settings - Fork 84
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
Provide a way to set a Counter
to an absolute value
#252
Comments
Would a const counter solve your use-case? https://docs.rs/prometheus-client/latest/prometheus_client/metrics/counter/struct.ConstCounter.html |
AFAIUI const counters just can't be changed at all? I want to be able to change the value, I just already have it pre-aggregated. |
You would use the Hope this is helpful. |
Hmm, this would require a lot of refactoring, but I think it could work. |
Actually, maybe not... Getting values from the target is async right now, and |
OK so some refactoring later, it looks like I can't really do this without |
I'm writing a reexporter for another service that already outputs aggregated metrics (but not in a Prometheus compatible format). It would be very convenient to be able to directly call
.set(existing_value)
on a Prometheus counter, instead of having to track the previous value manually andinc_by
a computed amount.The text was updated successfully, but these errors were encountered: