Skip to content

Add sampling by trace tags#3587

Merged
marcotc merged 1 commit into
masterfrom
tag-sampling
Apr 15, 2024
Merged

Add sampling by trace tags#3587
marcotc merged 1 commit into
masterfrom
tag-sampling

Conversation

@marcotc

@marcotc marcotc commented Apr 12, 2024

Copy link
Copy Markdown
Member

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 <[email protected]>
@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
Copy Markdown

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.

@TonyCTHsu TonyCTHsu left a comment

Copy link
Copy Markdown
Collaborator

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
@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.

4 participants