Reactor: ContextPropagationOperator should allow retrieval from ContextView #9263
Labels
contribution welcome
Request makes sense, maintainers probably won't have time, contribution would be welcome
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Starting in reactor 3.4+, to read from the subscriber context, reactor provides a read-only object of type
reactor.util.context.ContextView
.Prior to 3.4, reactor provided a read-write object of type
reactor.util.context.Context
when reading.Currently,
ContextPropagationOperator.getOpenTelemetryContext
takes an object of typereactor.util.context.Context
. Unfortunately this method cannot be used easily with reactor 3.4+, since an object of typereactor.util.context.Context
is not available when reading values from the context.Describe the solution you'd like
I'd like
ContextPropagationOperator
to provide an efficient method of reading values from areactor.util.context.ContextView
.Having said that
ContextPropagationOperator
needs to continue to work with older reactor versions that do not havereactor.util.context.ContextView
.Describe alternatives you've considered
Create a
Context
from aContextView
, and pass that toContextPropagationOperator.getOpenTelemetryContext
. Potentially creates garbage.Iterate over values in
ContextView
looking for one whosekey.toString().equals("otel-trace-context")
. Inefficient.The text was updated successfully, but these errors were encountered: