Expand description
§tailtriage-axum
Axum adapter crate for tailtriage request-boundary triage wiring.
This crate isolates framework-specific middleware and extractor ergonomics so tailtriage-tokio can stay framework-agnostic.
§Use from the repo
cargo run -p tailtriage-axum --example axum_minimal
cargo run -p tailtriage-axum --example axum_service_adoption
cargo run -p tailtriage-cli -- analyze tailtriage-run.json --format json§Add from crates.io
[dependencies]
tailtriage-core = "0.1.1"
tailtriage-axum = "0.1.1"§What this crate provides
middlewareto start and finish one tailtriage request per axum requestTailtriageRequestextractor for request-scoped instrumentation handlesTailtriageExtractorErrorrejection when middleware wiring is missing
§Minimal usage
use std::sync::Arc;
use axum::{extract::State, middleware::from_fn_with_state, routing::get, Router};
use tailtriage_axum::{middleware, TailtriageRequest};
use tailtriage_core::Tailtriage;
async fn checkout(TailtriageRequest(req): TailtriageRequest, State(_): State<()>) {
let _: Result<(), ()> = req.stage("inventory_lookup").await_on(async { Ok(()) }).await;
}
let app: Router<()> = Router::new()
.route("/checkout", get(checkout))
.layer(from_fn_with_state(tailtriage, middleware))
.with_state(());Suspects in analysis output are leads, not proof of root cause.
§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
- Tokio integration crate: https://github.com/SG-devel/tailtriage/tree/main/tailtriage-tokio
- CLI crate: https://github.com/SG-devel/tailtriage/tree/main/tailtriage-cli
Axum adoption helpers layered on top of
tailtriage-core.
This crate provides a focused middleware + extractor path so handlers can access request instrumentation without repeating request start/finish wiring.
Structs§
- Tailtriage
Extractor Error - Rejection returned when
TailtriageRequestis used without middleware. - Tailtriage
Request - Handler extractor for the request-scoped instrumentation handle.
Functions§
- crate_
name - Returns the crate name for smoke-testing workspace wiring.
- middleware
- Middleware that starts and finishes one tailtriage request per axum request.