feat: propagate configured request headers through query and task con… #20920
All Vouch review confidence checks passed
Residual risk 0.37 = Change Risk (0.69) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.69 · 461 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.069
Real PR Conversation Timeline
1 comments
"Review active on #20920"
general
weight: 0.35
agali-09
Description
Allows correlation metadata from inbound HTTP headers to follow Druid queries and submitted tasks.
Adds
druid.request.headers.headerToContextKeyto map HTTP headers to query and task context keys. The default mapping isX-Druid-Trace-Id→traceId; custom mappings replace the default, and{}disables configured capture and propagation. Configure participating services and task processes consistently, and restart them after changes.Configured headers are captured after authentication and copied into native query, SQL query, and HTTP-submitted task context. Captured values override matching context values; missing, blank, or invalid header values preserve existing values. Query-context authorization applies to captured and inherited query keys.
The change:
Druid does not generate IDs. Authentication extensions can supply missing IDs before capture through Authenticator.getFilter(). RequestHeaders and RequestHeaderContextConfig.fromContext(...) provide integration hooks for extensions and clients outside the paths covered here. This PR does not add OpenTelemetry spans or exporters.
Issue #11246 - Opentracing / Opentelemetry Support.
This PR extends and proposes a narrower alternative to #19572: configurable header capture, query and submitted task context transport, native query forwarding, and audit metadata. Request state stays on the HTTP request and in serialized operation context. ID generation and service-specific client propagation remain extension responsibilities.
Validation
Focused tests cover configuration, request capture, SQL and native query context, task submission, audit metadata, and native query forwarding and cancellation. Checkstyle, documentation spellcheck, and whitespace checks passed.
Release note
Druid can capture configured HTTP headers into query and submitted task context, forward them on native query fan-out and cancellation requests, and include captured metadata in audit entries. Configure the mapping with
druid.request.headers.headerToContextKey.<hr>
##### Key changed/added classes in this PR
<hr>
This PR has: