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 doc/release.md: Document release process (#373) 2020-12-14 13:55:54 +01:00
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 static-metric: fix typos in docstrings (#479) 2024-05-06 16:00:46 +02:00
.gitignore Ignore Intellij IDEA files and some others (#142) 2018-01-25 10:55:54 +08:00
CHANGELOG.md prometheus: release 0.14.0 (#545) 2025-03-27 16:33:36 +08:00
CODE_OF_CONDUCT.md Create a Code of Conduct (#193) 2018-09-07 10:24:43 +08:00
Cargo.toml prometheus: release 0.14.0 (#545) 2025-03-27 16:33:36 +08:00
LICENSE Update copyright header (#295) 2019-11-27 20:39:57 +08:00
Makefile Bump static-metric to 0.4 (#338) 2020-08-17 21:49:11 +08:00
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