Skip to content

Commit 203c719

Browse files
fix: disable readiness probe handler logs
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
1 parent 3d1bb6f commit 203c719

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)