Expand description
This is a module that records Tokio-tracing span latencies into Prometheus histograms directly. The name of the Prometheus histogram is “tracing_span_latencies[_sum/count/bucket]”
There is also the tracing-timing crate, from which this differs significantly:
- tracing-timing records latencies between events (logs). We just want to record the latencies of spans.
- tracing-timing does not output to Prometheus, and extracting data from its histograms takes extra CPU
- tracing-timing records latencies using HDRHistogram, which is great, but uses extra memory when one is already using Prometheus
Thus this is a much smaller and more focused module.
§Making spans visible
This module can only record latencies for spans that get created. By default, this is controlled by env_filter and logging levels.
Structs§
- A tokio_tracing Layer that records span latencies into Prometheus histograms