Skip to content

OTEL without Agent - Transaction lost if not bound to scope #3993

@lbloder

Description

@lbloder

Integration

sentry-opentelemetry-core

Java Version

17

Version

8.0.0-rc.2

Steps to Reproduce

  • Use the sentry-samples-console-opentelemetry-noagent sample or setup OTEL without agent in a simple java console application
  • Start and finish a transaction without calling makeCurrent
  • To make this more reproducible, also call the garbage collector
ITransaction lostTransaction = Sentry.startTransaction("lost transaction", "op");
System.gc();
lostTransaction.finish();

Expected Result

Transaction is sent to sentry

Actual Result

Transaction is not sent to sentry, because of a WeakReference to an OtelSpan in OtelSpanWrapper, which is garbage collected if not bound to scope

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