Skip to content

Refactor span tag processing API - #12808

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
bbujon/span-process-tags
Oct 12, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
bbujon/span-process-tags

Conversation

@PerfectSlayer

@PerfectSlayer PerfectSlayer commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What Does This Do

This PR replaces the four CoreSpan.processTagsAndBaggage* variants with a single method taking an int of options:

void processTagsAndBaggage(MetadataConsumer consumer, int options);
Option Meaning
STRUCTURED_LINKS The protocol encodes span links natively, so they are not added as the _dd.span_links tag
STRUCTURED_EVENTS The protocol encodes span events natively, so they are not added as the events tag
OWN_PROPAGATION_TAGS Serializes the span context's own propagation tags (the default option)
ROOT_PROPAGATION_TAGS Serializes the local root span context's propagation tags, as for the first span of a chunk

Motivation

Simplify API and make it more explicit:

  • DDSpan had 4 overrides and DDSpanContext 5 methods, built from combinations of booleans. Each new serialization need meant two more overloads. They are now a single method each.
  • Each call site now states what its protocol needs, instead of depending on which variant it picks and on how the interface defaults delegate to each other.
  • Test spans (PojoSpan, SimpleSpan, CountingPojoSpan) override a single method.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

🤖 Generated with Claude Code

@PerfectSlayer PerfectSlayer added comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring tag: ai generated Largely based on code generated by an AI or LLM labels Oct 9, 2026
@PerfectSlayer
PerfectSlayer added this pull request to stack #12809 October 9, 2026 08:51
@PerfectSlayer PerfectSlayer changed the title Unify span tag processing behind a single options-based method Refactor span tag processing API Oct 9, 2026
@PerfectSlayer
PerfectSlayer marked this pull request as ready for review October 9, 2026 08:55
@PerfectSlayer
PerfectSlayer requested review from a team as code owners October 9, 2026 08:55
@PerfectSlayer
PerfectSlayer requested review from dougqh and mhlidd and removed request for a team October 9, 2026 08:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T08:57:15.092647Z 87e65c0 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-09T08:59:29.158073Z 87e65c0 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-official datadog-official Bot left a comment

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.

Bits Code Review: PASS

More details

The migrated serializers preserve first-in-chunk root propagation tags, per-span propagation tags where previously used, and existing link, event, and baggage handling.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 87e65c0 · @DataDog review to ask questions

@datadog-official

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.93 s 13.90 s [-0.4%; +0.9%] (no difference)
startup:insecure-bank:tracing:Agent 12.86 s 12.98 s [-1.6%; -0.2%] (maybe better)
startup:petclinic:appsec:Agent 17.13 s 16.47 s [-0.6%; +8.5%] (no difference)
startup:petclinic:iast:Agent 16.48 s 16.92 s [-6.9%; +1.7%] (no difference)
startup:petclinic:profiling:Agent 16.55 s 16.91 s [-3.3%; -1.0%] (maybe better)
startup:petclinic:sca:Agent 17.10 s 16.94 s [-0.1%; +1.9%] (no difference)
startup:petclinic:tracing:Agent 16.07 s 16.13 s [-1.6%; +0.7%] (no difference)

Commit: 3bf09db8 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@PerfectSlayer
PerfectSlayer force-pushed the bbujon/span-process-tags branch from 87e65c0 to 4042930 Compare October 12, 2026 09:10
@PerfectSlayer
PerfectSlayer requested a review from a team as a code owner October 12, 2026 09:10

@datadog-official datadog-official Bot left a comment

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.

Bits Code Review: PASS

More details

The serializer options preserve existing link, event, and baggage handling, including root propagation tags on the first span of each chunk and own propagation tags for independent serialization.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 4042930

Base automatically changed from bbujon/span-links to master October 12, 2026 17:15
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot requested a review from a team as a code owner October 12, 2026 17:15
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot requested review from jordan-wong and removed request for a team October 12, 2026 17:15
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/span-process-tags branch from 4042930 to 3bf09db Compare October 12, 2026 17:23
@PerfectSlayer

Copy link
Copy Markdown
Collaborator Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-12 17:24:55 UTC ℹ️ Start processing command /merge


2026-10-12 17:25:01 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-10-12 18:32:18 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-10-12 19:45:20 UTC ℹ️ MergeQueue: This merge request was merged

@datadog-official datadog-official Bot left a comment

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.

Bits Code Review: PASS

More details

The new option flags preserve the previous propagation-tag choices at serialization call sites. Validation was limited to static analysis; tests and production behavior were not exercised.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 4042930

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit b92dde5 into master Oct 12, 2026
609 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the bbujon/span-process-tags branch October 12, 2026 19:45
@github-actions github-actions Bot added this to the 1.68.0 milestone Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants