Crates.io | prometheus-tokio |
lib.rs | prometheus-tokio |
version | 0.2.0 |
source | src |
created_at | 2023-03-31 14:55:31.087233 |
updated_at | 2023-04-03 11:14:06.921049 |
description | A collection of tokio runtime metrics for prometheus consumption |
homepage | https://github.com/gagbo/rust-prometheus-tokio |
repository | https://github.com/gagbo/rust-prometheus-tokio |
max_upload_size | |
id | 826504 |
size | 54,107 |
This project exposes a Tokio collector that is compatible with the prometheus crate that adds tokio runtime related metrics.
The project relies on a tokio_unstable
feature, so you need to add the flags
accordingly, e.g. by adding a .cargo/config.toml
file to your project with the
correct RUSTFLAGS, as is done here.
You can quickly test to look at the metrics that exist by using the example app:
cargo run --example complete-setup
# In another terminal
curl 127.0.0.1/metrics
Due to feature unification, note that bringing this crate in your project will
force the rt
feature of tokio
in your project. This should not be an
issue, given that runtime metrics hopefully make little sense if there is no
runtime to measure.
The crate has a single feature:
io_driver
enables the tokio/net
feature, and adds an extra metric that
reports the number of ready events processed by the runtime’s I/O driver.The project was kickstarted by Fiberplane during a "Hack day".