tikv / rust-prometheus

Prometheus instrumentation library for Rust applications
Apache License 2.0
1.07k stars 182 forks source link

Add `HistogramVec::with_label_values` #460

Closed XAMPPRocky closed 2 years ago

XAMPPRocky commented 2 years ago

Is your feature request related to a problem? Please describe. Going through the docs there seems to be missing functionality for HistogramVec's, namely that there's no way to get a Histogram out of it, you can only get LocalHistogram which as far as I can tell makes the type mostly useless for me, as I can't use it like Counter and Metric's vector equivalents and have to have a Vec<Histogram> instead.

Describe the solution you'd like The addition of a HistogramVec::with_label_values to get Histograms based on the provided label values.

tooboredtocode commented 2 years ago

HistogramVec is a MetricsVector which supports the get_metric_with_label_values method

XAMPPRocky commented 2 years ago

Ah thank you. That wasn't entirely clear from the docs, as I assumed the two methods it showed were the only methods available. Would be nice if it was more clear, but that's more a rustdoc issue