runtime-otel-metrics

Crates.ioruntime-otel-metrics
lib.rsruntime-otel-metrics
version0.2.0
sourcesrc
created_at2024-04-20 13:04:36.99471
updated_at2024-06-09 19:46:43.868692
descriptionMeter your tokio runtime and process memory with OpenTelemetry
homepage
repositoryhttps://github.com/max-te/runtime-otel-rs
max_upload_size
id1214593
size22,088
Maximilian Teegen (max-te)

documentation

README

runtime-otel-metrics

runtime-otel-metrics is an experimental crate that enables you to meter your tokio runtime and memory usage with OpenTelemetry. For tokio metrics it leans on tokio's unstable runtime metrics. For memory usage we use the memory-stats crate.

Usage

To use the tokio feature, you must compile with the rustc flag --cfg tokio_unstable.

// Register Tokio metrics with OpenTelemetry
runtime_otel_metrics::tokio_rt::register_tokio_metrics(
    tokio::runtime::Handle::current(),
    &opentelemetry::global::meter("tokio"),
)?;

// Register memory metrics
runtime_otel_metrics::memory::register(&opentelemetry::global::meter("memory"))?;

Similar crates

Commit count: 11

cargo fmt