Skip to content

How to exclude routes from tracing? #355

Discussion options

You must be logged in to vote

Add the /health route after the tracing middleware:

let app = Router::new()
  .route("/", post(MyController::create))
  .layer(...)
  .route("/health", get(health));

See the example for Router::layer: https://docs.rs/axum/0.2.5/axum/routing/struct.Router.html#method.layer

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@AlexKovalevych
Comment options

@davidpdrsn
Comment options

@AlexKovalevych
Comment options

Answer selected by davidpdrsn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants