Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DataDog/dd-trace-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.0
Choose a base ref
...
head repository: DataDog/dd-trace-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.6.1
Choose a head ref
  • 4 commits
  • 6 files changed
  • 3 contributors

Commits on Apr 14, 2026

  1. fix(tracer): preserve keep/drop possibility for OTel bridge on unsamp…

    …led spans (#4631)
    
    Fixes the OTel bridge's handling of unsampled spans in `FromGenericCtx`. Previously, when an OTel parent context had `IsSampled() == false`, the bridge set `samplingDecision = decisionDrop` directly on the trace. Bypassing the atomic Compare-And-Swap (CAS) semantics that `keep()` and `drop()` rely on.
    
    This meant:
    - Error spans could never rescue the trace as `keep()` only CAS from `decisionNone`, not `decisionDrop`
    - The behavior diverged from the native DD tracer, where P0 traces are not hard-dropped client-side
    
    The fix leaves `samplingDecision` as `decisionNone` for drop decisions while still setting the P0 priority and locking the trace against resampling. This preserves the OTel sampling intent while restoring the native DD keep/drop CAS flow.
    
    The bug has been introduced in `v2.6.0` following: #4238
    
    Fixes #4624
    
    Discovered during investigation of [APMS-19054](https://datadoghq.atlassian.net/browse/APMS-19054) — a customer upgrading to dd-trace-go v2.6.0 + OTel observed `trace.*` metrics dropping to near-zero under low sampling rates when client-side stats were disabled.
    
    - [ ] Changed code has unit tests for its functionality at or near 100% coverage.
    - [ ] [System-Tests](https://github.com/DataDog/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 `make lint` locally.
    - [ ] New code doesn't break existing tests. You can check this by running `make test` locally.
    - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes.
    - [ ] All generated files are up to date. You can check this by running `make generate` locally.
    - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally.
    
    [APMS-19054]: https://datadoghq.atlassian.net/browse/APMS-19054?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    
    Co-authored-by: kakkoyun <[email protected]>
    Co-authored-by: benjamin.debernardi <[email protected]>
    3 people committed Apr 14, 2026
    Configuration menu
    Copy the full SHA
    c9e8383 View commit details
    Browse the repository at this point in the history
  2. internal/version: v2.6.1

    genesor committed Apr 14, 2026
    Configuration menu
    Copy the full SHA
    cb29401 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9f22dd2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6d1ed74 View commit details
    Browse the repository at this point in the history
Loading