-
Notifications
You must be signed in to change notification settings - Fork 377
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 rule glob pattern support #3616
Conversation
Signed-off-by: Marco Costa <[email protected]>
REMOTE_USER_RULE = '-10' | ||
REMOTE_USER_RULE = '-11' | ||
# Dynamically configured rule, automatically generated by Datadog. | ||
REMOTE_DYNAMIC_RULE = '-11' | ||
REMOTE_DYNAMIC_RULE = '-12' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RFC was recently changed, and these numbers have been updated.
|
||
# A {Datadog::Tracing::Sampling::Matcher} that allows for arbitrary trace matching | ||
# based on the return value of a provided block. | ||
class ProcMatcher < Matcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arbitrary object matching is not required anymore, that this helper is no longer needed.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3616 +/- ##
==========================================
- Coverage 98.12% 98.12% -0.01%
==========================================
Files 1223 1223
Lines 72136 72097 -39
Branches 3425 3424 -1
==========================================
- Hits 70787 70748 -39
Misses 1349 1349 ☔ View full report in Codecov by Sentry. |
What does this PR do?
This PR adds support for matching sample rules not only by simple strings, but also buy a simple matching pattern. The matching is also case insensitive now.
This brings there will be tracer to parody with other tracing languages.
The following special characters are supported:
?
: matches any single character*
: matches any substringAdditional Notes:
Support for an arbitrary matcher your object has been removed, given the sampling APIs are now private and does not need such flexibility.
The glob pattern is the same for trace sampling and span sampling, so the code was refractored to share this complex matcher.
How to test the change?
They are unit tests and system tests for this change: DataDog/system-tests#2415