tailtriage-tokio
Tokio integration for tailtriage, including RuntimeSampler for periodic runtime snapshots.
Use from the repo
Add from crates.io
[]
= "0.1.1"
= "0.1.1"
What this crate provides
RuntimeSamplerfor periodic Tokio runtime snapshots- Runtime evidence enrichment on the same run artifact used for request instrumentation
- Works alongside the split lifecycle API from
tailtriage-core(StartedRequest { handle, completion })
Split lifecycle reminder
Request lifecycle ownership stays in tailtriage-core:
- start with
begin_request/begin_request_with - instrument via
started.handle - finish exactly once via
started.completion
shutdown() does not auto-finish pending requests. Unfinished requests are surfaced in run metadata, and strict_lifecycle(true) can make shutdown fail.
RuntimeSampler metric availability
Always available on stable Tokio:
alive_tasksglobal_queue_depth
Requires tokio_unstable:
local_queue_depthblocking_queue_depthremote_schedule_count
When tokio_unstable is not enabled, unstable-only fields are recorded as None.
Minimal usage
use Arc;
use Duration;
use Tailtriage;
use RuntimeSampler;
# async
Related docs
- Repo docs index: https://github.com/SG-devel/tailtriage/tree/main/docs
- Core crate: https://github.com/SG-devel/tailtriage/tree/main/tailtriage-core
- CLI crate: https://github.com/SG-devel/tailtriage/tree/main/tailtriage-cli
Axum adapter crate
Axum adoption helpers and axum examples live in tailtriage-axum.
The adapter is an ergonomics layer over core primitives. It does not claim production-hardening or zero-instrumentation auto-diagnosis.