Skip to content

fix(ddtrace/tracer): prevent applying rate to finished spans and add test coverage for this finishing code path#3474

Merged
darccio merged 2 commits into
mainfrom
dario.castane/finished-check-applyrate
Apr 30, 2025
Merged

fix(ddtrace/tracer): prevent applying rate to finished spans and add test coverage for this finishing code path#3474
darccio merged 2 commits into
mainfrom
dario.castane/finished-check-applyrate

Conversation

@darccio

@darccio darccio commented Apr 29, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Prevents race condition from #3472 by adding a span.finished check to our sampling logic.

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!

@darccio
darccio requested a review from a team as a code owner April 29, 2025 18:55
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Apr 29, 2025

Copy link
Copy Markdown

Datadog Report

Branch report: dario.castane/finished-check-applyrate
Commit report: ba5a43e
Test service: dd-trace-go

✅ 0 Failed, 4485 Passed, 65 Skipped, 4m 2.34s Total Time

Comment thread ddtrace/tracer/rules_sampler.go
@darccio
darccio force-pushed the dario.castane/finished-check-applyrate branch from aa13d65 to a9683c5 Compare April 30, 2025 08:58
@darccio
darccio requested a review from felixge April 30, 2025 08:58
@pr-commenter

pr-commenter Bot commented Apr 30, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-04-30 09:28:41

Comparing candidate commit a9683c5 in PR branch dario.castane/finished-check-applyrate with baseline commit c245968 in branch main.

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

scenario:BenchmarkInjectW3C-24

  • 🟥 execution_time [+82.001ns; +121.599ns] or [+2.016%; +2.990%]

@darccio
darccio merged commit 1a07f06 into main Apr 30, 2025
@darccio
darccio deleted the dario.castane/finished-check-applyrate branch April 30, 2025 09:46
darccio added a commit that referenced this pull request Apr 30, 2025
darccio added a commit that referenced this pull request Apr 30, 2025
darccio added a commit that referenced this pull request Apr 30, 2025
darccio added a commit that referenced this pull request Apr 30, 2025
…test coverage for this finishing code path (#3474 backport) (#3476)
darccio added a commit that referenced this pull request Apr 30, 2025
…test coverage for this finishing code path (#3474 backport) (#3476)
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.

3 participants