Skip to content

feat(cpp): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT [cpp@milan.garnier/propagation-behavior-extract]#7279

Draft
MilanGarnier wants to merge 10 commits into
mainfrom
milan.garnier/cpp-propagation-behavior-extract
Draft

feat(cpp): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT [cpp@milan.garnier/propagation-behavior-extract]#7279
MilanGarnier wants to merge 10 commits into
mainfrom
milan.garnier/cpp-propagation-behavior-extract

Conversation

@MilanGarnier

@MilanGarnier MilanGarnier commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Motivation

Add parametric coverage for DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT, supporting the C++ implementation in dd-trace-cpp#337.

Changes

  • Add shared parametric tests for the continue (default), restart, ignore, and restart with DD_TRACE_PROPAGATION_EXTRACT_FIRST=true behaviors. These closely follow the already existing end to end tests for other languages. Some are marked incomplete_test_app, completing the test app for these will be future work. (the goal here is to cover cpp fully and mostly other apps)
  • Validate extraction from Datadog and W3C headers, conflicting contexts, span-link metadata, injected headers, parentage, and baggage propagation.
  • Activate the suite for tracer versions that support each behavior, including C++ >2.1.1; document unsupported C++ baggage propagation and terminated-context span links.
  • Update the Rust parametric client so extracted restart contexts and baggage are preserved correctly during the tests.

Related PR

@MilanGarnier MilanGarnier changed the title (temporary) run on feature branch PR feat(tracing): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/parametric/test_extract_behavior.py                               @DataDog/system-tests-core @DataDog/apm-sdk-capabilities
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/php.yml                                                       @DataDog/apm-php @DataDog/asm-php
manifests/python.yml                                                    @DataDog/apm-python @DataDog/asm-python
manifests/ruby.yml                                                      @DataDog/ruby-guild @DataDog/asm-ruby
manifests/rust.yml                                                      @DataDog/apm-rust
utils/build/docker/rust/parametric/src/datadog/mod.rs                   @DataDog/apm-rust @DataDog/system-tests-core
utils/docker_fixtures/_test_clients/_test_client_parametric.py          @DataDog/system-tests-core

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 8, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 5 Pipeline jobs failed

Testing the test | System Tests (golang, dev) / parametric / parametric (1)   View in Datadog   GitHub Actions

🧪 8 Tests failed

tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default.test_multiple_tracecontexts[parametric-golang] from system_tests_suite   View in Datadog
assert 0 == 1
 +  where 0 = len([])

self = <tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default object at 0x7f25b783f3b0>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f258413e810>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f258497fbc0>

    def test_multiple_tracecontexts(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        with (
            test_library,
...
tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default.test_single_tracecontext[parametric-golang] from system_tests_suite   View in Datadog
Failed: DID NOT RAISE <class 'ValueError'>

self = <tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default object at 0x7f25b783fa70>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f2584d5ff20>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f2584d5d6d0>

    def test_single_tracecontext(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        with (
            test_library,
            test_library.dd_extract_headers_and_make_child_span("root", DATADOG_TRACECONTEXT_HEADERS) as span,
...
View all failed tests

Testing the test | System Tests (ruby, dev) / parametric / parametric (1)   View in Datadog   GitHub Actions

🧪 3 Tests failed

tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default.test_single_tracecontext[parametric-ruby] from system_tests_suite   View in Datadog
Failed: DID NOT RAISE <class 'ValueError'>

self = <tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default object at 0x7f01bd9b3c20>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f018a5d8dd0>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f018a917350>

    def test_single_tracecontext(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        with (
            test_library,
            test_library.dd_extract_headers_and_make_child_span("root", DATADOG_TRACECONTEXT_HEADERS) as span,
...
tests.parametric.test_extract_behavior.Test_ExtractBehavior_Ignore.test_multiple_tracecontexts[library_env0, parametric-ruby] from system_tests_suite   View in Datadog
Failed: DID NOT RAISE <class 'ValueError'>

self = <tests.parametric.test_extract_behavior.Test_ExtractBehavior_Ignore object at 0x7f580ffb3ef0>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f57dd40a540>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f57dd446de0>

    def test_multiple_tracecontexts(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        with (
            test_library,
            test_library.dd_extract_headers_and_make_child_span("root", CONFLICTING_TRACECONTEXT_HEADERS) as span,
...
View all failed tests

Testing the test | System Tests (ruby, prod) / parametric / parametric (1)   View in Datadog   GitHub Actions

🧪 3 Tests failed

tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default.test_single_tracecontext[parametric-ruby] from system_tests_suite   View in Datadog
Failed: DID NOT RAISE <class 'ValueError'>

self = <tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default object at 0x7f8969730290>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f893681ed50>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f89364c3350>

    def test_single_tracecontext(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        with (
            test_library,
            test_library.dd_extract_headers_and_make_child_span("root", DATADOG_TRACECONTEXT_HEADERS) as span,
...
tests.parametric.test_extract_behavior.Test_ExtractBehavior_Ignore.test_multiple_tracecontexts[library_env0, parametric-ruby] from system_tests_suite   View in Datadog
Failed: DID NOT RAISE <class 'ValueError'>

self = <tests.parametric.test_extract_behavior.Test_ExtractBehavior_Ignore object at 0x7fb8d05ddd60>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fb89d1a2480>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fb89d4f8cb0>

    def test_multiple_tracecontexts(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        with (
            test_library,
            test_library.dd_extract_headers_and_make_child_span("root", CONFLICTING_TRACECONTEXT_HEADERS) as span,
...
View all failed tests

View all 5 failed jobs.

❄️ 8 New flaky tests detected

tests.parametric.test_extract_behavior.Test_ExtractBehavior_Default.test_single_tracecontext[parametric-php] from system_tests_suite   View in Datadog
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

self = <Response [500]>, kwargs = {}

    def json(self, **kwargs):
        r"""Returns the json-encoded content of a response, if any.
    
        :param  Optional arguments that \`\`json.loads\`\` takes.
        :raises requests.exceptions.JSONDecodeError: If the response body does not
            contain valid json.
...

New test introduced in this PR is flaky.

tests.parametric.test_extract_behavior.Test_ExtractBehavior_Ignore.test_multiple_tracecontexts[library_env0, parametric-cpp] from system_tests_suite   View in Datadog
AssertionError: assert False
 +  where False = span_has_no_parent({'duration': 83661538, 'error': 0, 'meta': {'_dd.p.dm': '-4', '_dd.p.tid': '1111111111111111', 'language': 'cpp', 'runtime-id': 'a16b877a-b130-435e-a00c-bd2894d950be'}, 'metrics': {'_sampling_priority_v1': 2.0, 'process_id': 1.0}, ...})

self = <tests.parametric.test_extract_behavior.Test_ExtractBehavior_Ignore object at 0x7ff9abd258b0>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7ff978d26180>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7ff978d278c0>

    def test_multiple_tracecontexts(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        with (
            test_library,
...

New test introduced in this PR is flaky.

View in Flaky Test Management

ℹ️ Info

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

Useful? React with 👍 / 👎

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

@MilanGarnier MilanGarnier force-pushed the milan.garnier/cpp-propagation-behavior-extract branch from 45a957f to 58054c7 Compare July 8, 2026 14:38
@MilanGarnier MilanGarnier changed the title feat(tracing): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT feat(cpp): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT Jul 8, 2026
@MilanGarnier MilanGarnier force-pushed the milan.garnier/cpp-propagation-behavior-extract branch from 58054c7 to 3b4dac7 Compare July 8, 2026 15:59
@MilanGarnier MilanGarnier changed the title feat(cpp): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT feat(cpp): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT [cpp@milan.garnier/propagation-behavior-extract] Jul 13, 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.

1 participant