Skip to content

a minimal, allocation-free Prometheus/OpenMetrics metrics implementation for `no-std` and embedded Rust.

License

Notifications You must be signed in to change notification settings

hawkw/tinymetrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinymetrics

a minimal, allocation-free Prometheus/OpenMetrics metrics implementation for no-std and embedded projects.

crates.io Documentation MIT licensed Test Status Sponsor @hawkw on GitHub Sponsors

why should you use it?

you may want to use this crate if:

  1. you want the Prometheus/OpenMetrics text exposition format. other metrics systems are not supported. if you want a generic way to record metrics that can be emitted in a number of different formats, the i highly recommend the metrics crate and its ecosystem, which provide a generic facade implementation that can be used with multiple metrics systems. however, these libraries may be less suitable for use in embedded systems — read on for why.
  2. you can't (or don't want to) allocate memory dynamically. this crate is intended to allow all metrics storage to be declared in statics, for use in embedded systems and other no-std use-cases. in order to support completely static usage, this crate has some additional limitations over other Prometheus/OpenMetrics implementations. in particular:
  3. the cardinality of metrics labels is known ahead of time. because tinymetrics stores metrics in static, fixed-size arrays, the maximum size of the label set of each metric must be declared at compile time. this is an inherent limitation to using static storage, but it may be acceptable if you only want to expose a small number of metrics with known labels.
  4. you only need counter and gauge metrics. i haven't implemented the summary and histogram metric types yet, although it would be nice to eventually.

About

a minimal, allocation-free Prometheus/OpenMetrics metrics implementation for `no-std` and embedded Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published