Skip to content

Commit

Permalink
Merge pull request #776 from fabriziosestito/fix/disable-logs-readine…
Browse files Browse the repository at this point in the history
…ss-probe

fix: disable readiness probe handler logs
  • Loading branch information
flavio authored May 23, 2024
2 parents 2286f65 + 203c719 commit 1293e33
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));

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

Expand Down

0 comments on commit 1293e33

Please sign in to comment.