Skip to content

Configuring span factory for OpenTelemetry too late causes issues #4005

@adinauer

Description

@adinauer

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions