fix(ddtrace): ensure sampling is propagated on OpenTelemetry
What does this PR do?
Fixes #3639.
Reviewer's Checklist
- [ ] Changed code has unit tests for its functionality at or near 100% coverage.
- [ ] System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
- [ ] There is a benchmark for any new code, or changes to existing code.
- [ ] If this interacts with the agent in a new way, a system test has been added.
- [ ] New code is free of linting errors. You can check this by running
./scripts/lint.shlocally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes.
- [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
Unsure? Have a question? Request a review!
Benchmarks
Benchmark execution time: 2025-12-02 09:32:26
Comparing candidate commit 4a29ea64294cdf4ae38841ce830e98acc0c42271 in PR branch dario.castane/er/issue-3639 with baseline commit f7d92e7439000bdc929d0a5b0d691290792b3b0a in branch main.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics.
⚠️ Warnings
❄️ 1 New flaky test detected
TestGlobalFunctionsfromgithub.com/DataDog/dd-trace-go/v2/internal/orchestrion/_integration/net_http(Datadog)Failed === RUN TestGlobalFunctions generated_test.go:25: Running setup agent.go:78: mockagent: starting base.go:35: Error Trace: /home/runner/work/dd-trace-go/dd-trace-go/dd-trace-go/internal/orchestrion/_integration/net_http/base.go:35 /opt/hostedtoolcache/go/1.24.10/x64/src/runtime/asm_amd64.s:1700 Error: Target error should be in err chain: expected: "http: Server closed" ...
🧪 1 Test failed
This comment will be updated automatically if new data arrives.
TestSamplingDecisionfromgithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry(Datadog)Failed === RUN TestSamplingDecision tracer_test.go:424: Error Trace: /Users/runner/work/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/tracer_test.go:424 Error: Should be true Test: TestSamplingDecision Messages: parent span is sampled, but child span is not sampled 2025/12/02 09:15:55 Datadog Tracer v2.5.0-dev ERROR: lost 1 traces: Post "http://localhost:8126/v0.4/traces": dial tcp 127.0.0.1:8126: connect: connection refused, 4 additional messages skipped (first occurrence: 02 Dec 25 09:15 UTC) --- FAIL: TestSamplingDecision (0.04s)
🔗 Commit SHA: 4a29ea6 | Docs | Datadog PR Page | Was this helpful? Give us feedback!
Hi team do we plan to deploy this? Is there a card where I can follow the progress? Thanks!
@mxderouet This PR wasn't intended to be merged. It was part of an investigation by APM DCS LP. SDK took over and I think the best solution, already in review, is #4238.
I'm closing this one as it's no longer relevant.