getsentry / sentry-java

A Sentry SDK for Java, Android and other JVM languages.
https://docs.sentry.io/
MIT License
1.16k stars 435 forks source link

Add provider for OpenTelemetry propagator #3733

Open adinauer opened 2 months ago

adinauer commented 2 months ago

Description

See https://github.com/getsentry/sentry-java/issues/2254#issuecomment-1575492805

adinauer commented 1 month ago

There is already a provider (https://github.com/getsentry/sentry-java/blob/main/sentry-opentelemetry/sentry-opentelemetry-agentcustomization/src/main/java/io/sentry/opentelemetry/SentryPropagatorProvider.java) but it's located in the sentry-opentelemetry-agentcustomization. This dependency has to be added as an additional dependency for now. We should do more testing towards using our OpenTelemetry offering without an agent and see if that's all that's needed.

There's likely going to be problems around classloaders when simply adding the contents of the module to e.g. sentry-opentelemetry-core as it's currently loaded into a separate classloader for the agent.