#openmetrics #prometheus #metrics #instrumentation #monitoring

open-metrics-client

Open Metrics client library allowing users to natively instrument applications

17 releases (breaking)

0.14.0 Dec 29, 2021
0.13.0 Nov 21, 2021
0.12.1 Nov 9, 2021
0.11.2 Jun 9, 2021
0.4.0 Dec 31, 2020

#63 in Visualization

Download history 2543/week @ 2022-08-17 2557/week @ 2022-08-24 2542/week @ 2022-08-31 2332/week @ 2022-09-07 2176/week @ 2022-09-14 1801/week @ 2022-09-21 1926/week @ 2022-09-28 2115/week @ 2022-10-05 1457/week @ 2022-10-12 1724/week @ 2022-10-19 1608/week @ 2022-10-26 2286/week @ 2022-11-02 1822/week @ 2022-11-09 1428/week @ 2022-11-16 1585/week @ 2022-11-23 1675/week @ 2022-11-30

7,297 downloads per month

Apache-2.0 OR MIT

79KB
1.5K SLoC

Open Metrics 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/open-metrics-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.

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

~335–740KB
~17K SLoC