Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddtrace/tracer: fixed resampling to occur on root span only #2824

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

dianashevchenko
Copy link
Contributor

@dianashevchenko dianashevchenko commented Aug 21, 2024

What does this PR do?

This PR updates sampling logic. Now, resampling only occurs on root spans. Neither"_dd.limit_psr", nor "_dd.rule_psr" should be present on the child span.
Locking the span after context propagation prevents re-sampling.

Motivation

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.
  • 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!

@dianashevchenko dianashevchenko marked this pull request as ready for review August 21, 2024 12:14
@dianashevchenko dianashevchenko requested a review from a team as a code owner August 21, 2024 12:14
Copy link
Member

@darccio darccio left a comment

Choose a reason for hiding this comment

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

LGTM

@pr-commenter
Copy link

pr-commenter bot commented Aug 21, 2024

Benchmarks

Benchmark execution time: 2024-08-21 13:49:30

Comparing candidate commit ed09cd1 in PR branch shevchenko/sample-tags-root-only with baseline commit e4985df in branch main.

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

scenario:BenchmarkSetTagString-24

  • 🟥 execution_time [+6.192ns; +8.108ns] or [+5.489%; +7.187%]

@dianashevchenko dianashevchenko enabled auto-merge (squash) August 22, 2024 15:35
@dianashevchenko dianashevchenko merged commit 81e27e5 into main Aug 22, 2024
161 of 165 checks passed
@dianashevchenko dianashevchenko deleted the shevchenko/sample-tags-root-only branch August 22, 2024 15:42
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