#openmetrics #prometheus #metrics #instrumentation #monitoring

prometheus-client

Open Metrics client library allowing users to natively instrument applications

6 releases (breaking)

Uses new Rust 2021

new 0.18.0 Aug 16, 2022
0.17.0 Jul 18, 2022
0.16.0 May 3, 2022
0.15.1 Feb 4, 2022
0.1.0 Jan 13, 2022

#85 in Visualization

Download history 6687/week @ 2022-04-26 11534/week @ 2022-05-03 12404/week @ 2022-05-10 16770/week @ 2022-05-17 14625/week @ 2022-05-24 15202/week @ 2022-05-31 14419/week @ 2022-06-07 17998/week @ 2022-06-14 16605/week @ 2022-06-21 15023/week @ 2022-06-28 15930/week @ 2022-07-05 18484/week @ 2022-07-12 22545/week @ 2022-07-19 24089/week @ 2022-07-26 22396/week @ 2022-08-02 22692/week @ 2022-08-09

95,692 downloads per month
Used in 15 crates (4 directly)

Apache-2.0 OR MIT

81KB
1.5K SLoC

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".

  • Protobuf wire format. (Follow spec issue.)

  • Gauge histogram metric.

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

  • Summary metric.

Related Libraries

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.

Dependencies

~0.7–6MB
~102K SLoC