-
Hi, We are using Finagle as our primary I/O library. Finagle already have a mechanism for propagating context between thread within a process. It should be pretty trivial for us to write a custom ContextStorageProvider that is backed by this mechanism ensuring that trace context are properly passed within our applications. While it's pretty clear that using custom ContextStorageProvider is supported when using manual instrumentation, it's not clear to us if using custom ContextStorageProvider with the java agent is supported. So I was wondering if it was officially supported? If not, would you expect it to work? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can customize the agent with an extension, see https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/examples/extension There you could use |
Beta Was this translation helpful? Give feedback.
You can customize the agent with an extension, see https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/examples/extension There you could use
ContextStorageProvider
SPI to provide your own context storage just like with manual instrumentation. Keep in mind that agent code is in a different class loader from your application and does not have access to your application classes. It is clear that if you choose to replace the default context storage with something that uses finagle from your application you'll have to apply some pretty serious magic. I personally would attempt instrumenting finagle to propagate otel context instead of trying to replace the agent con…