Restrict the accepted amount of extracted tags and baggage#3854
Conversation
Signed-off-by: Bob Weinand <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 665c963eb4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (*valptr == '~') { | ||
| *valptr = '='; | ||
| tags_size += keylen + sizeof("_dd.") + valuelen; | ||
| if (tags_size < 512) { |
There was a problem hiding this comment.
Accept tracestate tags at the 512-byte boundary
The new extraction guard rejects tag payloads whose computed size is exactly 512 bytes because it uses tags_size < 512 after incrementing tags_size. In this codebase, the same propagation limit is treated as inclusive elsewhere (e.g., x-datadog-tags extraction rejects only when length is > 512), so a boundary-sized tracestate payload now gets incorrectly marked with _dd.propagation_error=extract_max_size and dropped. This causes avoidable tag loss for requests that are precisely at the documented/expected cap.
Useful? React with 👍 / 👎.
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 665c963 | Docs | Datadog PR Page | Give us feedback! |
Benchmarks [ tracer ]Benchmark execution time: 2026-05-04 14:24:21 Comparing candidate commit 665c963 in PR branch Found 4 performance improvements and 5 performance regressions! Performance is the same for 184 metrics, 1 unstable metrics. scenario:MessagePackSerializationBench/benchMessagePackSerialization
scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache
scenario:PDOBench/benchPDOOverhead
scenario:PDOBench/benchPDOOverheadWithDBM
scenario:PHPRedisBench/benchRedisOverhead
scenario:SamplingRuleMatchingBench/benchRegexMatching2
scenario:SamplingRuleMatchingBench/benchRegexMatching3
scenario:SamplingRuleMatchingBench/benchRegexMatching4
scenario:SpanBench/benchOpenTelemetryInteroperability-opcache
|
| if (*valptr == '~') { | ||
| *valptr = '='; | ||
| tags_size += keylen + sizeof("_dd.") + valuelen; | ||
| if (tags_size < 512) { |
There was a problem hiding this comment.
nit: Would be cleaner to use a named constant here
Prevent too many items in tag/baggage lists.