Skip to content

otel sampling fix#3623

Closed
mtoffl01 wants to merge 4 commits intov1-maintenancefrom
mtoff/otel-sampling-fix
Closed

otel sampling fix#3623
mtoffl01 wants to merge 4 commits intov1-maintenancefrom
mtoff/otel-sampling-fix

Conversation

@mtoffl01
Copy link
Copy Markdown
Contributor

@mtoffl01 mtoffl01 commented Jun 11, 2025

What does this PR do?

Locks the trace sampling priority when it's been inherited by a parent span context.

Motivation

APMS-15887

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 golangci-lint run locally.
  • 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!

@mtoffl01 mtoffl01 changed the base branch from main to v1-maintenance June 11, 2025 18:33
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Jun 11, 2025

Benchmarks

Benchmark execution time: 2025-07-02 17:54:16

Comparing candidate commit 21ca316 in PR branch mtoff/otel-sampling-fix with baseline commit f94844a in branch v1-maintenance.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 1 unstable metrics.

scenario:BenchmarkSetTagStringer-24

  • 🟩 execution_time [-7.816ns; -3.924ns] or [-5.277%; -2.650%]

Comment thread ddtrace/tracer/tracer_test.go
Comment thread ddtrace/tracer/spancontext.go Outdated
Comment on lines +472 to +473
t.setLocked(true)
// t.locked = true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mtoffl01 This causes a deadlock because t is already locked at the beginning of finishedOne.

darccio and others added 2 commits June 20, 2025 08:20
Co-authored-by: Dario Castañé <dario.castane@datadoghq.com>
@mtoffl01 mtoffl01 closed this Jul 2, 2025
@mtoffl01
Copy link
Copy Markdown
Contributor Author

mtoffl01 commented Jul 2, 2025

Closing in favor of #3718

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