w4 / serde_prometheus

:pager: serde-based serializer for prometheus' text-based exposition format
Other
4 stars 5 forks source link

Can this library serialize a field of type `Vec` to Prometheus' histogram? #1

Closed changweige closed 3 years ago

w4 commented 3 years ago

Hi,

There's no direct support for generating a histogram, but it can easily implemented in your application or a higher level library. There is some support for serialising a histogram using serde_prometheus in metered-rs, however it's worth noting this generates a summary not a histogram. But it serves as a fairly decent base for histograms: https://github.com/magnet/metered-rs/commit/b6b61979a2727e3be58737015ba11eb63309ed6b

changweige commented 3 years ago

Thanks. It really helps