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

Add sampling by trace tags #3587

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Add sampling by trace tags #3587

merged 1 commit into from
Apr 15, 2024

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Apr 12, 2024

What does this PR do?
This PR expands the sampling rule engine to allow for matching on traces based on their tags and metrics.
In ddtrace, both tags (string value) and metrics (float value) are called tags, but the matcher has a few implementation details that makes it work with both.

How to test the change?

There are unit tests in this PR, as well as system tests: https://github.com/DataDog/system-tests/blob/373c58b012da02794385510cb083001f5a0b9013/tests/parametric/test_trace_sampling.py#L302

Unsure? Have a question? Request a review!

Signed-off-by: Marco Costa <marco.costa@datadoghq.com>
@marcotc marcotc requested review from a team as code owners April 12, 2024 22:05
@marcotc marcotc requested a review from ZStriker19 April 12, 2024 22:06
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 98.63014% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 98.25%. Comparing base (ce32588) to head (1cd50e0).
Report is 12 commits behind head on master.

Files Patch % Lines
spec/datadog/tracing/sampling/rule_spec.rb 91.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #3587    +/-   ##
========================================
  Coverage   98.24%   98.25%            
========================================
  Files        1254     1255     +1     
  Lines       74375    74545   +170     
  Branches     3529     3537     +8     
========================================
+ Hits        73073    73241   +168     
- Misses       1302     1304     +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@TonyCTHsu TonyCTHsu left a comment

Choose a reason for hiding this comment

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

LGTM

@marcotc marcotc merged commit de232e9 into master Apr 15, 2024
207 checks passed
@marcotc marcotc deleted the tag-sampling branch April 15, 2024 18:55
@TonyCTHsu TonyCTHsu modified the milestone: 1.22.0 Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants