Replies: 1 comment 2 replies
-
Mono/Flux uses context that was active when it was subscribed. You could use something like return new Publisher<T>() {
@Override
public void subscribe(Subscriber<? super T> subscriber) {
try (Scope ignore = Context.root().makeCurrent()) {
delegate.subscribe(subscriber);
}
}
}; to reset the context. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Similar to issue: 6427
I need to split traces into multiple smaller ones, due to size limits of traces in our Grafana/Tempo setup.
This time in a reactive context.
This works fine when working with Monos but not Flux:
The log: OTEL is written with the new trace/span id, but the code running in supplier is not.
I have been experimenting with defer/deferContextual and removing .contextWrite with same issue.
with Mono:
This works as expected with Mono, the new trace used in supplier.
How should I set up the Flux case for it to work?
Beta Was this translation helpful? Give feedback.
All reactions