8

GitHub - hawkw/tinymetrics: a minimal, allocation-free Prometheus/OpenMetrics me...

 1 year ago
source link: https://github.com/hawkw/tinymetrics
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

tinymetrics

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

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 Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK