Prometheus instrumentation library for Rust applications
Go to file
Matheus Cardoso 1d3174bf5d
chore(histogram): Simplify code by using std lib method (#547)
* chore(histogram): Simplify code by using std lib method

Leverage existing standard library method to simplify implementation. No changes to public API or MSRV.

Signed-off-by: Matheus <cardosaum@pm.me>

* refactor(histogram): Remove `duration_to_seconds` function

Signed-off-by: Matheus <cardosaum@pm.me>

* tests(histogram): Remove `duration_to_second` test

After removing the aforementioned method in a previous commit, this test became obsolete.

Signed-off-by: Matheus <cardosaum@pm.me>

---------

Signed-off-by: Matheus <cardosaum@pm.me>
Co-authored-by: Luca Bruno <lucab@lucabruno.net>
2025-04-16 09:37:45 +02:00
.github cargo: bump MSRV to 1.81 (#539) 2025-03-13 00:00:20 +08:00
benches Hashing improvements (#532) 2025-03-21 10:44:25 +01:00
docs
examples build(deps): update hyper requirement from ^0.14 to ^1.4 (#524) 2025-03-19 16:16:45 +01:00
proto cargo: upgrade to protobuf 3.7 (#541) 2025-03-19 10:21:43 +01:00
src chore(histogram): Simplify code by using std lib method (#547) 2025-04-16 09:37:45 +02:00
static-metric
.gitignore
CHANGELOG.md prometheus: release 0.14.0 (#545) 2025-03-27 16:33:36 +08:00
CODE_OF_CONDUCT.md
Cargo.toml prometheus: release 0.14.0 (#545) 2025-03-27 16:33:36 +08:00
LICENSE
Makefile
README.md README.md: Document protobuf feature (#531) 2024-12-13 10:41:36 +01:00
build.rs cargo: upgrade to protobuf 3.7 (#541) 2025-03-19 10:21:43 +01:00

README.md

Prometheus Rust client library

Build Status docs.rs crates.io

This is the Rust client library for Prometheus. The main data structures and APIs are ported from Go client.

Documentation

Find the latest documentation at https://docs.rs/prometheus.

Advanced

Crate features

This crate provides several optional components which can be enabled via Cargo [features]:

  • protobuf: Protobuf support, enabled by default.

  • gen: To generate protobuf client with the latest protobuf version instead of using the pre-generated client.

  • nightly: Enable nightly only features.

  • process: Enable process metrics support.

  • push: Enable push metrics support.

Static Metric

When using a MetricVec with label values known at compile time prometheus-static-metric reduces the overhead of retrieving the concrete Metric from a MetricVec.

See static-metric directory for details.

Thanks