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

Reactor: ContextPropagationOperator should allow retrieval from ContextView #9263

Closed
philsttr opened this issue Aug 21, 2023 · 1 comment · Fixed by #11235
Closed

Reactor: ContextPropagationOperator should allow retrieval from ContextView #9263

philsttr opened this issue Aug 21, 2023 · 1 comment · Fixed by #11235
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request

Comments

@philsttr
Copy link
Contributor

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 type reactor.util.context.Context. Unfortunately this method cannot be used easily with reactor 3.4+, since an object of type reactor.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 a reactor.util.context.ContextView.

Having said that ContextPropagationOperator needs to continue to work with older reactor versions that do not have reactor.util.context.ContextView.

Describe alternatives you've considered

Create a Context from a ContextView, and pass that to ContextPropagationOperator.getOpenTelemetryContext. Potentially creates garbage.

Iterate over values in ContextView looking for one whose key.toString().equals("otel-trace-context"). Inefficient.

@philsttr philsttr added the enhancement New feature or request label Aug 21, 2023
@mateuszrzeszutek mateuszrzeszutek added the needs triage New issue that requires triage label Aug 25, 2023
@mateuszrzeszutek
Copy link
Member

Hey @philsttr ,

Thanks for filing this! This definitely makes sense to me 👍

Reactor introduced ContextView in 3.4 -- we'll have to bump the minimum supported version to 3.4, and probably add a new common module for the code that's shared between the library (now 3.4) and javaagent (still 3.1) instrumentation.

@mateuszrzeszutek mateuszrzeszutek added contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome and removed needs triage New issue that requires triage labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants