You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lack of consistency in retrieval of observed values #235
Counter and Gauge allow retrieving the current value.
Family half-allows it - there's get_or_create, but that has the side-effect of creating the value if non-existent.
Histogram and Info don't allow it at all.
Now, in production, there's not much use, but in tests, I'd rather be able to test the values directly rather than encode and parse back the text format. Would you mind a pull request allowing clean retrieval of:
Activity
mxinden commentedon Feb 9, 2025
Note that there is
Family::getnow: #234See discussion in #242
iustin commentedon Feb 13, 2025
Thanks, then I'll subscribe to the histogram count and sum pull request.
There's still the question of retrieving info strings, unless I'm mistaken?
mxinden commentedon Feb 14, 2025
I assume you don't want to retrieve the value of an Info metric, since that will always be
1.Existence of a Info metric label combination in e.g. a
Familyyou can test viaFamily::get:https://docs.rs/prometheus-client/latest/prometheus_client/metrics/family/struct.Family.html#method.get
iustin commentedon Feb 19, 2025
Excellent, thanks for the explanation. Then I'll close this in favour of watching the remaining pull request.