fix(logging): remove duplicate request_id field in request lifecycle logs#8307
fix(logging): remove duplicate request_id field in request lifecycle logs#8307sengopal wants to merge 5 commits into
Conversation
"request received" and "request completed" fire on every inbound request, producing excessive log noise at default log levels. Debug is the correct level for per-request chatter; info should be reserved for meaningful state changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WalkthroughTwo logging statements in the request lifecycle handler are downgraded from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The handle_payload span already carries request_id, component, endpoint, namespace, and instance_id. Explicitly repeating request_id in the info! call caused it to appear twice in log output. Drop the redundant field so all structured context comes from the span once. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| if let Some(request_id) = &self.request_id { | ||
| tracing::info!(request_id = %request_id, "request completed"); | ||
| if self.request_id.is_some() { | ||
| tracing::info!("request completed"); |
There was a problem hiding this comment.
🟡 Log level accidentally reverted from debug to info in Drop impl
The immediately preceding commit (2af9c9aa6e) deliberately downgraded these per-request lifecycle logs from info to debug (commit message: "fix(runtime): downgrade per-request lifecycle logs from info to debug"). This commit, which only intends to remove the duplicate request_id field, accidentally changes tracing::debug! back to tracing::info!. In production with high request volume, this will cause excessive logging at the info level — exactly the problem the previous commit fixed.
| tracing::info!("request completed"); | |
| tracing::debug!("request completed"); |
Was this helpful? React with 👍 or 👎 to provide feedback.
| if let Some(rid) = &request_id { | ||
| tracing::info!(request_id = %rid, "request received"); | ||
| if request_id.is_some() { | ||
| tracing::info!("request received"); |
There was a problem hiding this comment.
🟡 Log level accidentally reverted from debug to info in handle_payload
Same issue as in the Drop impl: the previous commit (2af9c9aa6e) deliberately downgraded this log from info to debug, and this commit accidentally reverts it back to info while removing the request_id field. This will produce a noisy info-level "request received" log for every incoming request.
| tracing::info!("request received"); | |
| tracing::debug!("request received"); |
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
question: is the intent here to remove duplicate fields or change level ? If change level - then we should have a discussion as we purposefully wanted to have these at info level - perhaps its info level at the frontend and debug at the worker - but we should come up with a general guidance. |
Summary
Fixes duplicate
request_idappearing twice on everyrequest received/request completedlog line in the worker.The
handle_payloadspan already carriesrequest_idas a span field (along withcomponent,endpoint,namespace,instance_id). The explicitrequest_id = %ridargument in theinfo!calls caused the field to be emitted a second time — once as a bare unquoted value (event field) and once as a quoted string (span field).Before (raw log from original report —
request_idduplicated on every line):After (captured on this PR with Qwen3-0.6B / SGLang —
request_idonce, from span):Changes
lib/runtime/src/pipeline/network/ingress/push_handler.rsrequest_idfield from"request received"and"request completed"info!calls — the span provides itTest plan
request_idappears only once per lifecycle log linecomponent,endpoint,namespace,instance_idstill present in output via span context🤖 Generated with Claude Code