diff --git a/http/Cargo.toml b/http/Cargo.toml index 8e8ac41..8c20fb1 100644 --- a/http/Cargo.toml +++ b/http/Cargo.toml @@ -12,7 +12,8 @@ server = [ "dep:tower-http", "dep:serde_urlencoded", "eva/tokio", - "tokio/net" + "tokio/net", + "dep:fastrace-axum" ] [dependencies] @@ -35,3 +36,4 @@ serde_urlencoded = { version = "0.7.1", optional = true } tokio = { workspace = true, optional = true } reqwest = { optional = true, version = "0.12.23", default-features = false } +fastrace-axum = { optional = true, version = "0.1.3" } diff --git a/http/src/server/mod.rs b/http/src/server/mod.rs index 0680239..fa3d0cd 100644 --- a/http/src/server/mod.rs +++ b/http/src/server/mod.rs @@ -47,7 +47,9 @@ pub async fn serve(rx: SlaveRx, config: config::Config, router: axum::Router) -> pub fn make_router(service: T::Service) -> axum::Router { let scope = handler::RouterScope::root(State:: { service }); - routes::make(scope).into_axum() + routes::make(scope) + .into_axum() + .layer(fastrace_axum::FastraceLayer) } #[perfect_derive(Clone)]