#open-metrics #encode #auxiliary #derive #monitoring #instrumentation #traits

macro prometheus-client-derive-encode

Auxiliary crate to derive Encode trait from prometheus-client

3 releases

0.4.2 Aug 11, 2023
0.4.1 Jan 4, 2023
0.4.0 Dec 10, 2022

#822 in Procedural macros

Download history 59326/week @ 2023-12-18 29107/week @ 2023-12-25 49308/week @ 2024-01-01 61373/week @ 2024-01-08 70449/week @ 2024-01-15 71545/week @ 2024-01-22 72320/week @ 2024-01-29 67157/week @ 2024-02-05 69312/week @ 2024-02-12 80768/week @ 2024-02-19 79205/week @ 2024-02-26 78533/week @ 2024-03-04 84371/week @ 2024-03-11 86109/week @ 2024-03-18 83690/week @ 2024-03-25 96436/week @ 2024-04-01

353,702 downloads per month
Used in 216 crates (via prometheus-client)

Apache-2.0 OR MIT

9KB
162 lines

Prometheus Rust client library

Test Status Crate API

Rust client library implementation of the Open Metrics specification. Allows developers to instrument applications and thus enables operators to monitor said applications with monitoring systems like Prometheus.

Documentation: https://docs.rs/prometheus-client/

Goals

  • No unsafe. Don't use unsafe Rust within the library itself.

  • Type safe. Leverage Rust's type system to catch common instrumentation mistakes at compile time.

  • Fast. Don't force users to worry about the performance impact of instrumentation. Instead encourage users to instrument often and extensively.

Specification Compliance

Below is a list of properties where this client library implementation lags behind the Open Metrics specification. Not being compliant with all requirements (MUST and MUST NOT) of the specification is considered a bug and likely to be fixed in the future. Contributions in all forms are most welcome.

  • State set metric.

  • Enforce "A Histogram MetricPoint MUST contain at least one bucket".

  • Enforce "A MetricFamily MUST have a [...] UNIT metadata".

  • Enforce "MetricFamily names [...] MUST be unique within a MetricSet."

  • Enforce "Names SHOULD be in snake_case".

  • Enforce "MetricFamily names beginning with underscores are RESERVED and MUST NOT be used unless specified by this standard".

  • Enforce "Exposers SHOULD avoid names that could be confused with the suffixes that text format sample metric names use".

  • Gauge histogram metric.

  • Allow "A MetricPoint in a Metric with the type [Counter, Histogram] SHOULD have a Timestamp value called Created".

  • Summary metric.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Derive crate for prometheus_client.

Dependencies

~325–770KB
~18K SLoC