Skip to content

v1: serialize span links as structured data and honor baggage tag config.#11810

Open
AlexeyKuznetsov-DD wants to merge 1 commit into
masterfrom
alexeyk/refactor-v1-baggage-and-span-links
Open

v1: serialize span links as structured data and honor baggage tag config.#11810
AlexeyKuznetsov-DD wants to merge 1 commit into
masterfrom
alexeyk/refactor-v1-baggage-and-span-links

Conversation

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor

What Does This Do

Replaces the v1 trace payload's CoreSpan.processTagsAndBaggage(consumer, injectLinksAsTags, injectBaggageAsTags) with a purpose-named processTagsAndBaggageWithStructuredLinks(consumer):

  • Span links stay structuredv1 serializes links as first-class data and no longer flattens them into the _dd.span_links tag (injectLinksAsTags = false).
  • Baggage-as-tags now follows tracer configv1 previously hard-coded injectBaggageAsTags = false; it now respects the configured value, aligning v1 with the v0.4/V0.5 paths.
  • Drops the now-unused 3-arg overload from CoreSpan (replaced by a default method), DDSpan, DDSpanContext, and the test doubles (SimpleSpan, TraceGenerator).

On the test side:

  • Adds real-span v1 coverage in DDSpanSerializationTest.java (structured links not flattened; configured baggage tags).
  • Extracts the duplicated msgpack v1 decoder into a shared V1PayloadReader, now used by both DDSpanSerializationTest and TraceMapperV1PayloadTest.

Motivation

system-tests failed on my branch when I enabled v1 by default for tests in Test_Headers_Baggage_Span_Tags.

Additional Notes

Verified:

  • ./gradlew :dd-trace-core:test --tests DDSpanSerializationTest --tests TraceMapperV1PayloadTest passes; spotlessApply clean.
  • system-tests passed locally: DD_TRACE_DEBUG=true TEST_LIBRARY=java ./run.sh PARAMETRIC tests/parametric/test_headers_baggage.py --force-dd-trace-debug with both modes: v1 or v04 enabled.

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Jun 30, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring labels Jun 30, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD marked this pull request as ready for review June 30, 2026 18:23
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD requested a review from a team as a code owner June 30, 2026 18:23
@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 1, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-01 19:28:13 UTC ℹ️ Start processing command /merge
Use /merge -c to cancel this operation!


2026-07-01 19:28:18 UTC ℹ️ MergeQueue: pull request added to the queue

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

Use /merge -c to cancel this operation!


⏳ Processing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core 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