Skip to content

Restrict the accepted amount of extracted tags and baggage#3854

Merged
bwoebi merged 1 commit into
masterfrom
bob/telem-bounds
May 6, 2026
Merged

Restrict the accepted amount of extracted tags and baggage#3854
bwoebi merged 1 commit into
masterfrom
bob/telem-bounds

Conversation

@bwoebi

@bwoebi bwoebi commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Prevent too many items in tag/baggage lists.

@bwoebi
bwoebi requested a review from a team as a code owner May 4, 2026 13:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@datadog-official

datadog-official Bot commented May 4, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.64% (-0.06%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 665c963 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented May 4, 2026

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-05-04 14:24:21

Comparing candidate commit 665c963 in PR branch bob/telem-bounds with baseline commit 82abdf3 in branch master.

Found 4 performance improvements and 5 performance regressions! Performance is the same for 184 metrics, 1 unstable metrics.

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟥 execution_time [+2.539µs; +3.061µs] or [+2.372%; +2.860%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟥 execution_time [+2.418µs; +3.962µs] or [+2.347%; +3.846%]

scenario:PDOBench/benchPDOOverhead

  • 🟩 execution_time [-9.154µs; -7.188µs] or [-3.597%; -2.824%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟩 execution_time [-9.616µs; -7.035µs] or [-3.768%; -2.756%]

scenario:PHPRedisBench/benchRedisOverhead

  • 🟩 execution_time [-50.371µs; -34.414µs] or [-5.015%; -3.427%]

scenario:SamplingRuleMatchingBench/benchRegexMatching2

  • 🟥 execution_time [+52.030ns; +139.370ns] or [+3.566%; +9.552%]

scenario:SamplingRuleMatchingBench/benchRegexMatching3

  • 🟥 execution_time [+57.527ns; +126.873ns] or [+3.895%; +8.591%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4

  • 🟥 execution_time [+73.433ns; +147.167ns] or [+5.040%; +10.101%]

scenario:SpanBench/benchOpenTelemetryInteroperability-opcache

  • 🟩 execution_time [-20.179µs; -16.452µs] or [-6.761%; -5.512%]

if (*valptr == '~') {
*valptr = '=';
tags_size += keylen + sizeof("_dd.") + valuelen;
if (tags_size < 512) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Would be cleaner to use a named constant here

@bwoebi
bwoebi merged commit 43072cc into master May 6, 2026
2119 of 2123 checks passed
@bwoebi
bwoebi deleted the bob/telem-bounds branch May 6, 2026 15:09
@github-actions github-actions Bot added this to the 1.20.0 milestone May 6, 2026
@bwoebi bwoebi modified the milestones: 1.20.0, 1.19.2 May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants