Description
When moving options.setSpanFactory(SpanFactoryFactory.create(new LoadClass(), NoOpLogger.getInstance())); from the SentryOptions ctor to Sentry.init OpenTelemetry ends some spans early.
We don't know why that happens yet.
The agentless sample does not have the "spanCreatedThroughSentryApi" span due to e.g. "spanCreatedThroughOtelApi" being ended early and the startChild call thus NoOping. Setting an earlier breakpoint causes the behaviour to change and leads to "personSpanThroughOtelAnnotation" being ended prematurely. When removing the @WithSpan annotation, it's the root span that's ended too early.
Also see #3995 (comment)
Description
When moving
options.setSpanFactory(SpanFactoryFactory.create(new LoadClass(), NoOpLogger.getInstance()));from theSentryOptionsctor toSentry.initOpenTelemetry ends some spans early.We don't know why that happens yet.
The agentless sample does not have the "spanCreatedThroughSentryApi" span due to e.g. "spanCreatedThroughOtelApi" being ended early and the
startChildcall thus NoOping. Setting an earlier breakpoint causes the behaviour to change and leads to "personSpanThroughOtelAnnotation" being ended prematurely. When removing the@WithSpanannotation, it's the root span that's ended too early.Also see #3995 (comment)