Avoid logging S3 proxy requests as info

This commit is contained in:
Diego Imbert
2026-04-02 17:02:53 +02:00
parent a76c67cb6b
commit b6359a7a03

View File

@@ -65,14 +65,28 @@ impl<B> MakeSpan<B> for MyMakeSpan {
.get(TRACING_HEADER.as_str())
.and_then(|x| x.to_str().map(|x| x.to_string()).ok())
.unwrap_or(Uuid::new_v4().to_string());
tracing::info_span!(
"request",
method = %request.method(),
uri = %request.uri(),
username = field::Empty,
workspace_id = field::Empty,
traceId = tracing_id,
email = field::Empty,
)
if request.uri().path().contains("/s3_proxy/") {
// Use debug level for S3 proxy requests to avoid log spam from
// high-frequency range requests (e.g. DuckDB reading Parquet files)
tracing::debug_span!(
"request",
method = %request.method(),
uri = %request.uri(),
username = field::Empty,
workspace_id = field::Empty,
traceId = tracing_id,
email = field::Empty,
)
} else {
tracing::info_span!(
"request",
method = %request.method(),
uri = %request.uri(),
username = field::Empty,
workspace_id = field::Empty,
traceId = tracing_id,
email = field::Empty,
)
}
}
}