nm_otel
OpenTelemetry bridge for nm metrics.
This crate provides a bridge between nm metrics and OpenTelemetry,
enabling export of nm-collected metrics to any OpenTelemetry-compatible backend.
Example
use Duration;
use ;
use Clock;
async
Exported metrics
Each nm::Event is exported as one or more OpenTelemetry metrics:
| nm data | OpenTelemetry type | Metric name |
|---|---|---|
| count | counter | {event} |
| sum | gauge | {event}_sum |
| histogram | counter per bucket | {event}_bucket with le attribute |
Histogram format
Histograms are exported as separate counter and gauge metrics because the OpenTelemetry Rust SDK does not yet support recording pre-aggregated histogram data.
The format uses cumulative bucket counts with a le (less-than-or-equal) attribute:
http_latency_ms_bucket{le="10"} → observations ≤ 10
http_latency_ms_bucket{le="50"} → observations ≤ 50
http_latency_ms_bucket{le="100"} → observations ≤ 100
http_latency_ms_bucket{le="+Inf"} → all observations
http_latency_ms → total observation count
http_latency_ms_sum → sum of all observed values
See also
More details in the package documentation.
This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.