Skip to content

Instrument ContextPropagationOperator to bridge lib/agent calls - #4786

Merged
trask merged 8 commits into
open-telemetry:mainfrom
lmolkova:reactor-context-agent-bridge
Dec 7, 2021
Merged

Instrument ContextPropagationOperator to bridge lib/agent calls#4786
trask merged 8 commits into
open-telemetry:mainfrom
lmolkova:reactor-context-agent-bridge

Conversation

@lmolkova

@lmolkova lmolkova commented Dec 2, 2021

Copy link
Copy Markdown
Member

Fixes reactor part of #4666

@trask trask left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx @lmolkova!

@mateuszrzeszutek @anuraaga would be great to get your thoughts on this. It's similar to the bridging we do on the OpenTelemetry API, but applied to a library instrumentation, which feels a little odd since typically I think of users using either library instrumentation -or- javaagent instrumentation, but not needing to use both. Maybe we could split out part of the reactor instrumentation module into an opentelemetry-extension-reactor module (similar to opentelemetry-extension-kotlin)?

public class ContextPropagationOperatorInstrumentation implements TypeInstrumentation {
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return named("application.io.opentelemetry.instrumentation.reactor.ContextPropagationOperator");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@iNikem

iNikem commented Dec 3, 2021

Copy link
Copy Markdown
Contributor

which feels a little odd since typically I think of users using either library instrumentation -or- javaagent instrumentation, but not needing to use both.

Library itself can provide native/library instrumentation and then app developer brings in the agent. So this scenario is totally possible.

@mateuszrzeszutek

Copy link
Copy Markdown
Member

@mateuszrzeszutek @anuraaga would be great to get your thoughts on this. It's similar to the bridging we do on the OpenTelemetry API, but applied to a library instrumentation, which feels a little odd since typically I think of users using either library instrumentation -or- javaagent instrumentation, but not needing to use both.

I like this PR (and muzzle changes in #4797); perhaps we'll need to implement a similar bridge for the instrumentation-api in the future (other than the SpanKeys).

@lmolkova
lmolkova force-pushed the reactor-context-agent-bridge branch from c661bde to b19b66f Compare December 6, 2021 20:01

@mateuszrzeszutek mateuszrzeszutek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Thanks!

@trask
trask merged commit 1995852 into open-telemetry:main Dec 7, 2021
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
…-telemetry#4786)

* Instrument ContextPropagationOperator to bridge lib/agent calls

* more tests

* clean up

* up

* lint

* more lint

* make runWithContext(Flux, ..) public

* lint
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.

4 participants