add fastrace layer
This commit is contained in:
parent
6e4aed3ce9
commit
3708d13ee9
2 changed files with 6 additions and 2 deletions
|
@ -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" }
|
||||
|
|
|
@ -47,7 +47,9 @@ pub async fn serve(rx: SlaveRx, config: config::Config, router: axum::Router) ->
|
|||
|
||||
pub fn make_router<T: Types>(service: T::Service) -> axum::Router {
|
||||
let scope = handler::RouterScope::root(State::<T> { service });
|
||||
routes::make(scope).into_axum()
|
||||
routes::make(scope)
|
||||
.into_axum()
|
||||
.layer(fastrace_axum::FastraceLayer)
|
||||
}
|
||||
|
||||
#[perfect_derive(Clone)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue