Fix projectreactor instrumentation to keep span context connected#1308
Merged
Conversation
tylerbenson
reviewed
Mar 11, 2020
Contributor
tylerbenson
left a comment
There was a problem hiding this comment.
It's difficult to understand the impact of this change, so I'm relying a bit on the tests.
Contributor
Author
|
@tylerbenson I updated the top level comment to include an overview of the implications |
tylerbenson
reviewed
Mar 13, 2020
337f353 to
5095a52
Compare
2036e63 to
9da6500
Compare
Contributor
Author
|
Opening back up for review, working on a couple failing tests in |
devinsba
commented
Apr 24, 2020
32aa51a to
90c0e72
Compare
tylerbenson
reviewed
Apr 24, 2020
Contributor
tylerbenson
left a comment
There was a problem hiding this comment.
a few questions, but it is looking really nice!
tylerbenson
reviewed
Apr 27, 2020
devinsba
commented
Apr 28, 2020
added 10 commits
April 28, 2020 11:21
0153835 to
d206d3b
Compare
tylerbenson
suggested changes
Apr 28, 2020
d206d3b to
915b5f6
Compare
tylerbenson
approved these changes
Apr 29, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes issue where the reactive lettuce client spans can be orphaned. This would also be an issue with spring WebClient.
supersedes #1203
fixes #1100
fixes #1178
Notes on the implication:
The largest change here is the use of reactor's built in hook mechanism. This wraps (almost) every Publisher (including Operator which implements Publisher and Subscriber) with our tracing function. The scope for any given operator is the one active at the time of creation. So if I have a pre-existing
Fluxand attach some operators to it while scoped to a span, all of those operators will have that span as their scope as soon as they execute.The Webflux client uses a combination of a
WebClientnative filter, and a very targeted instrumentation that handles copying the current span from the reactor context, to the netty channel attributesGiven the time required to make the above changes, the server instrumentation was not changed beyond making the tests pass again. Given enough time I would also update the webflux server instrumentation to use filters directly instead of the special purpose instrumentations for each handler type.