-
Notifications
You must be signed in to change notification settings - Fork 435
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: removed restriction of non-empty fields in sampling rules #1510
Merged
dianashevchenko
merged 5 commits into
main
from
shevchenko/default-values-for-sampling-rule
Oct 12, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cd3a001
removed restriction of non-empty fields in sampling rules
dianashevchenko af250a0
unset sample rate for single span sampling defaults to 0
dianashevchenko 35e789c
added more test examples to single span sampling rules unmarshalling
dianashevchenko 7705823
Merge branch 'main' into shevchenko/default-values-for-sampling-rule
dianashevchenko 8be0648
updated the sampling section in doc.go
dianashevchenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So if neither name nor service are supplied what does the rule do? (And can we add that to the documentation here to clarify it for future readers)
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.
According to the RFC, and the implementation in other tracers there shouldn't be solid restrictions like we had before. I am confident that there should be a check to discard a rule like
{"service":"*", "name":"*", "sampling_rate": 1}
in whatever form it comes. If the customer wants to allow all sampling, it should be done without misusing this API. Wdyt?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.
Yeah I definitely agree that setting it to
*
for both fields is a clear mis-use of the API so restricting it makes sense to me. I'm still confused what the intended behavior of having an empty name and empty service name since I don't think any spans can have both be empty? So the rule would just never match anything?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.
On the contrary, empty means it "match all"