Skip to content
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

Fix reactor context propagation in latest reactor #4377

Merged
merged 2 commits into from
Oct 14, 2021

Conversation

lmolkova
Copy link
Contributor

Fixes #4372 introduced in #4159

The newer reactor does not support a hack dummy.flatMap(i -> publisher) to force publisher in onNext (i.e. with current() span)

It seems there is optimization or some different path that causes the below branch to run, skipping context instrumentation

// if Flux/Mono #just, #empty, #error
if (publisher instanceof Fuseable.ScalarCallable) {
return sub;
}

One way to solve it would be to enable context propagation for scalars, but it probably would be bad for performance.

Instead, I went down the road of creating a small custom Mono impl instead of dummy that implements context propagation in subscribe call.

@trask
Copy link
Member

trask commented Oct 14, 2021

@lmolkova looks like ./gradlew :instrumentation:reactor-3.1:library:codenarcTest is failing, usually for me that means I used semi-colons in groovy code 😢

@iNikem iNikem merged commit dfb1529 into open-telemetry:main Oct 14, 2021
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Fix build and minor issue

* codenarc

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nightly build failed
5 participants