Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ manifest:
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_config_with_empty_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_default: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_key_with_asterisk: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_no_trace_context: missing_feature
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_specific_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_datadog.py::Test_Headers_Datadog: ">1.0.0"
tests/parametric/test_headers_none.py::Test_Headers_None: ">1.0.0"
Expand Down
1 change: 1 addition & 0 deletions manifests/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ manifest:
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_config_with_empty_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_default: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_key_with_asterisk: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_no_trace_context: missing_feature
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_specific_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_opm.py: missing_feature (Org Propagation Guard RFC not yet implemented)
? tests/parametric/test_headers_precedence.py::Test_Headers_Precedence::test_headers_precedence_propagationstyle_default_datadog_tracecontext
Expand Down
1 change: 1 addition & 0 deletions manifests/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ manifest:
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_config_with_empty_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_default: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_key_with_asterisk: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_no_trace_context: missing_feature # tracer applies baggage tags only in httptrace middleware, not in core tracer.StartSpan
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_specific_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_opm.py: missing_feature (Org Propagation Guard RFC not yet implemented)
? tests/parametric/test_headers_precedence.py::Test_Headers_Precedence::test_headers_precedence_propagationstyle_default_datadog_tracecontext
Expand Down
1 change: 1 addition & 0 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3735,6 +3735,7 @@ manifest:
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage::test_headers_baggage_default_D001: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage::test_headers_baggage_only_D002: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags: v1.54.0-SNAPSHOT+c2aec92b86
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_no_trace_context: missing_feature
tests/parametric/test_headers_opm.py: v1.64.0-SNAPSHOT
? tests/parametric/test_headers_precedence.py::Test_Headers_Precedence::test_headers_precedence_propagationstyle_default_datadog_tracecontext
: - declaration: missing_feature (Implemented from 1.24.0)
Expand Down
1 change: 1 addition & 0 deletions manifests/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,7 @@ manifest:
tests/parametric/test_headers_b3.py::Test_Headers_B3::test_headers_b3_migrated_single_key_propagate_valid: missing_feature (Need to remove b3=b3multi alias)
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage: irrelevant (uses weblog tests)
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags: *ref_5_54_0
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_no_trace_context: missing_feature
tests/parametric/test_headers_opm.py: missing_feature (Org Propagation Guard RFC not yet implemented)
? tests/parametric/test_headers_precedence.py::Test_Headers_Precedence::test_headers_precedence_propagationstyle_default_datadog_tracecontext
: - declaration: missing_feature (Implemented in 4.20.0 (and 3.41.0))
Expand Down
1 change: 1 addition & 0 deletions manifests/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ manifest:
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_config_with_empty_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_default: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_key_with_asterisk: missing_feature # Created by easy win activation script
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_no_trace_context: missing_feature
tests/parametric/test_headers_baggage.py::Test_Headers_Baggage_Span_Tags::test_baggage_span_tags_specific_keys: missing_feature # Created by easy win activation script
tests/parametric/test_headers_datadog.py::Test_Headers_Datadog: v0.0.1
tests/parametric/test_headers_none.py::Test_Headers_None: v0.0.1
Expand Down
16 changes: 16 additions & 0 deletions tests/parametric/test_headers_baggage.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,19 @@ def test_baggage_span_tags_config_with_empty_keys(self, test_agent: TestAgentAPI
assert meta.get("baggage.account.id") == "12345"
assert meta.get("baggage.foo") is None
assert meta.get("baggage.test") is None

def test_baggage_span_tags_no_trace_context(self, test_agent: TestAgentAPI, test_library: APMLibrary) -> None:
"""Baggage span tags must be applied to a local root span even when no upstream trace context is present.
A request that carries only a baggage header (no x-datadog-* or traceparent headers) still creates a
local root span, and that span must receive the configured baggage tags."""
with test_library:
_ = test_library.dd_make_child_span_and_get_headers(
[("baggage", "user.id=doggo,session.id=mysession,foo=bar")]
Comment on lines +435 to +436

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

)

span = find_only_span(test_agent.wait_for_num_traces(1))
meta = span.get("meta")
assert meta is not None
assert meta.get("baggage.user.id") == "doggo"
assert meta.get("baggage.session.id") == "mysession"
assert meta.get("baggage.foo") is None
5 changes: 5 additions & 0 deletions utils/build/docker/php/parametric/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ function remappedSpanKind($spanKind) {
} else {
$span = \DDTrace\start_trace_span();
}
} elseif (array_key_exists('', $spansDistributedTracingHeaders)) {
// baggage-only: no upstream trace context, but consume headers so baggage tags are applied
$span = \DDTrace\start_trace_span();
\DDTrace\consume_distributed_tracing_headers($spansDistributedTracingHeaders['']);
unset($spansDistributedTracingHeaders['']);
} else {
$span = \DDTrace\start_trace_span();
}
Expand Down
8 changes: 7 additions & 1 deletion utils/build/docker/ruby/parametric/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,13 @@ def handle_trace_span_start(req, res)
args = StartSpanArgs.new(JSON.parse(req.body.read))
# If the parent span is the active span, we don't need to create a digest,
# let the tracer handle span parenting. This avoids creating a new trace chunk.
digest = unless Datadog::Tracing.active_span&.id == args.parent_id
# Special case: if parent_id is nil and a baggage-only digest exists, use it
# so that baggage tags are applied to the new root span.
digest = if args.parent_id.nil? && DD_DIGEST.key?(nil)
DD_DIGEST.delete(nil)
elsif Datadog::Tracing.active_span&.id == args.parent_id
nil
else
get_digest(args.parent_id)
end

Expand Down
Loading