Skip to content

Commit

Permalink
fix: disable readiness probe handler logs
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrizio Sestito <[email protected]>
  • Loading branch information
fabriziosestito committed May 23, 2024
1 parent 3d1bb6f commit 203c719
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,16 @@ impl PolicyServer {
.route("/audit/:policy_id", post(audit_handler))
.route("/validate/:policy_id", post(validate_handler))
.route("/validate_raw/:policy_id", post(validate_raw_handler))
.route("/readiness", get(readiness_handler))
.with_state(state.clone())
.layer(
TraceLayer::new_for_http()
.make_span_with(trace::DefaultMakeSpan::new().level(Level::INFO))
.on_response(trace::DefaultOnResponse::new().level(Level::INFO)),
);
)
// Adding the readiness probe handler after the tracing layer to avoid logging
// See: https://github.com/tokio-rs/axum/discussions/355
.route("/readiness", get(readiness_handler));

Check warning on line 227 in src/lib.rs

View check run for this annotation

Codecov / codecov/patch

src/lib.rs#L227

Added line #L227 was not covered by tests

if config.enable_pprof {
activate_memory_profiling().await?;

Expand Down

0 comments on commit 203c719

Please sign in to comment.