fix(router): propagate trace context through worker dispatch - #13713
fix(router): propagate trace context through worker dispatch#13713wei-core wants to merge 2 commits into
Conversation
Signed-off-by: WikAlie <194917782+wei-core@users.noreply.github.com>
|
👋 Hi wei-core! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe KV router now creates parented OpenTelemetry request spans and propagates distributed trace context to selected workers. Tests verify trace headers, request identifiers, and child span creation. ChangesKV router tracing
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized tracing change preserves request context across worker dispatch and includes targeted validation; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Comment |
Signed-off-by: WikAlie <194917782+wei-core@users.noreply.github.com>
Overview
Preserve the frontend OpenTelemetry trace when the KV push router dispatches a request to the selected worker.
Summary
kv_router.route_requestan always-on request-plane spanDetails
The route span previously relied on the ambient tracing parent. That parent is not reliable across the KV-router dispatch boundary, so downstream request-plane header injection could start a separate trace.
The new helper records the complete distributed context on the route span and calls
set_parentbefore instrumentingdispatch_exactordirect. The test exercises the detached-parent case with an unsampled W3C context and checkstraceparent,tracestate,x-request-id, andrequest-id.Where should the reviewer start?
lib/llm/src/kv_router/push_router.rs, especiallyroute_request_spanandroute_request_span_propagates_distributed_trace_context.Validation
cargo fmt --all -- --checkcargo metadata --locked --format-version 1in.,lib/bindings/python,lib/runtime/examples, andlib/bindings/kvbmcargo test --locked -p dynamo-llm --no-default-features route_request_span_propagates_distributed_trace_context -- --nocapture— 1 passedcargo clippy --locked -p dynamo-llm --no-default-features --lib --tests -- -D warningsRelated Issues
Summary by CodeRabbit