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.
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 new filter methods #1973
Add new filter methods #1973
Changes from 13 commits
e66104b
a12c96f
0510795
7b104a1
8f26227
e45da8f
e8f10d9
c3da622
b1aad56
9242b5d
ed10ba3
6371aa0
7d35fc5
a162473
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I mostly guessed here: should the
filter.on_new_span
method be called withcx.with_filter
or just withcx
? I don't really understand these details here.Also, I guessed that it might be more correct to first update the filters and then the layer, not sure if that can make a difference or of the filter should be called last.
The question about the order of
filter
andlayer
calls applies to all four changes in this fileThere 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.
This is a good question. The difference is that calling
cx.with_filter(...)
means that the context will filter out any spans from the current span context that were previously disabled by that filter. I think it makes sense for the filter to not see any spans that it previously filtered out. So, passing thewith_filter
context to the filter is probably the right thing.I don't think it actually makes a difference which order the methods are called in. The filter can only enable/disable things in its
enabled
method, not inon_$WHATEVER
, so calling theon_$WHATEVER
method is only going to effect the nextenabled
call. It won't have an effect on what the inner layer sees in itson_$WHATEVER
method. So, we can actually call them in whatever order and it shouldn't make a difference.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.
Good to know about the order though. Thanks for the explanations!