Skip to content

test(parametric): add baggage span tags test for no trace context#7211

Open
rachelyangdog wants to merge 3 commits into
mainfrom
rachel/baggage-span-tags-no-trace-context
Open

test(parametric): add baggage span tags test for no trace context#7211
rachelyangdog wants to merge 3 commits into
mainfrom
rachel/baggage-span-tags-no-trace-context

Conversation

@rachelyangdog

Copy link
Copy Markdown
Contributor

Adds test_baggage_span_tags_no_trace_context to verify that baggage tags are applied to the local root span even when no upstream trace context (x-datadog-* or traceparent) is present — scenario 2 from the baggage RFC.

Marks the test as missing_feature for golang, rust, dotnet, and cpp, consistent with the existing baggage span tag tests for those libraries.

Motivation

Changes

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

…nario

Adds test_baggage_span_tags_no_trace_context to verify that baggage tags
are applied to the local root span even when no upstream trace context
(x-datadog-* or traceparent) is present — scenario 2 from the baggage
RFC.

Marks the test as missing_feature for golang, rust, dotnet, and cpp,
consistent with the existing baggage span tag tests for those libraries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rachelyangdog rachelyangdog requested review from a team as code owners June 24, 2026 16:22
@rachelyangdog rachelyangdog requested review from cataphract and mabdinur and removed request for a team June 24, 2026 16:22
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/cpp.yml                                                       @DataDog/dd-trace-cpp
manifests/dotnet.yml                                                    @DataDog/apm-dotnet @DataDog/asm-dotnet
manifests/golang.yml                                                    @DataDog/dd-trace-go-guild
manifests/java.yml                                                      @DataDog/asm-java @DataDog/apm-java
manifests/nodejs.yml                                                    @DataDog/dd-trace-js
manifests/rust.yml                                                      @DataDog/apm-rust
tests/parametric/test_headers_baggage.py                                @DataDog/system-tests-core @DataDog/apm-sdk-capabilities
utils/build/docker/php/parametric/server.php                            @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/ruby/parametric/server.rb                            @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 2 Pipeline jobs failed

Testing the test | lint / lint   View in Datadog   GitHub Actions

Testing the test | all-jobs-are-green   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

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

@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: fa90117ea5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +435 to +436
_ = test_library.dd_make_child_span_and_get_headers(
[("baggage", "user.id=doggo,session.id=mysession,foo=bar")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate baggage-only span-tag test for Java

When this new baggage-only case runs with TEST_LIBRARY=java, the Java parametric app drops baggage-only extraction before the child span is created: /trace/span/extract_headers returns span_id: null whenever the extracted context is null or has an empty span id (utils/build/docker/java/parametric/src/main/java/com/datadoghq/trace/opentracing/controller/OpenTracingController.java:204-210), and startSpan only attaches extracted context when a non-null parent id is provided (OpenTracingController.java:75-86). Since manifests/java.yml:3737 activates the whole Test_Headers_Baggage_Span_Tags class, this test will create an ordinary local root without the extracted baggage and fail the new tag assertions; please either update the Java parametric extraction path to preserve baggage-only context or add a Java manifest entry for this test.

Useful? React with 👍 / 👎.

…for java/nodejs/php/ruby

Java's parametric server drops baggage-only extraction (span_id null when
no trace context). PHP, Ruby, and Node.js parametric servers have the same
issue. The actual tracers for PHP and Ruby handle scenario 2 correctly, but
their parametric servers need fixes first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rachelyangdog rachelyangdog requested review from a team as code owners June 25, 2026 15:20
PHP and Ruby tracers already apply baggage tags independently of trace
context, but their parametric servers were dropping the extracted context
when no trace span ID was present.

PHP: add an elseif branch for the empty-string key (PHP coerces null array
keys to "") so consume_distributed_tracing_headers is called even when no
upstream span ID was extracted.

Ruby: check DD_DIGEST[nil] before the active-span short-circuit so a
baggage-only digest is passed as continue_from when parent_id is nil.

Removes missing_feature for php and ruby. Go remains missing_feature because
its tracer applies baggage tags only in the httptrace middleware, not in the
core tracer.StartSpan path used by the parametric server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gh-worker-ownership-write-b05516 gh-worker-ownership-write-b05516 Bot removed the request for review from a team June 25, 2026 15:31
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