Skip to content

Commit 1293e33

Browse files
authored
Merge pull request #776 from fabriziosestito/fix/disable-logs-readiness-probe
fix: disable readiness probe handler logs
2 parents 2286f65 + 203c719 commit 1293e33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,16 @@ impl PolicyServer {
216216
.route("/audit/:policy_id", post(audit_handler))
217217
.route("/validate/:policy_id", post(validate_handler))
218218
.route("/validate_raw/:policy_id", post(validate_raw_handler))
219-
.route("/readiness", get(readiness_handler))
220219
.with_state(state.clone())
221220
.layer(
222221
TraceLayer::new_for_http()
223222
.make_span_with(trace::DefaultMakeSpan::new().level(Level::INFO))
224223
.on_response(trace::DefaultOnResponse::new().level(Level::INFO)),
225-
);
224+
)
225+
// Adding the readiness probe handler after the tracing layer to avoid logging
226+
// See: https://github.com/tokio-rs/axum/discussions/355
227+
.route("/readiness", get(readiness_handler));
228+
226229
if config.enable_pprof {
227230
activate_memory_profiling().await?;
228231

0 commit comments

Comments
 (0)