Skip to content

Investigate how to best combine sentry-opentelemetry-* with OTLP #5096

@adinauer

Description

@adinauer

Description

Some customers prefer to use OTLP over having Sentry hook into OpenTelemetry inside the SDK.

While it should be possible to use OpenTelemetry SDK (not sentry-opentelemetry-*) and combine it with Sentry SDK (again not sentry-opentelemetry-*), customers would miss out on benefits we get from OpenTelemetry (especially their Java Agent and Spring Boot integration).

These benefits are:

  • Sentry Scopes propagation, i.e. making Sentry work properly with certain libraries (e.g. RxJava, Reactor)
  • Picking up incoming tracing info and attaching outgoing tracing info for more libraries to have better distributed tracing

Off the top of my head, we'd require some changes to the SDK:

  • probably a flag (OTLP mode), telling the Sentry SDK to not register certain hooks, only relevant for Performance / Spans (but keep hooks we need to gain the benefits mentioned above)
  • SentrySampler could just not be registered if the flag is enabled, not quite sure about consequences of this without deeper investigation since it might break some things
  • Propagator might need to work differently but maybe it's also OK to just have it do some unnecessary work; but also could break things if kept as is in OTLP mode
  • OtelSentrySpanProcessor likely also needs to be adapted, e.g. to perform isolation scope forking (if we don't want Sentry integrations to take over this part which would likely be incomplete due to lower library coverage compared to OTel)
    • Other SDKs do not fork isolation scope in span processor but rely on integrations to fork

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions