Class OtelSpanWrapper

java.lang.Object
io.sentry.opentelemetry.OtelSpanWrapper
All Implemented Interfaces:
io.sentry.ISpan, io.sentry.opentelemetry.IOtelSpanWrapper

@Internal public final class OtelSpanWrapper extends Object implements io.sentry.opentelemetry.IOtelSpanWrapper
NOTE: This wrapper is not used when using OpenTelemetry API, only when using Sentry API.
  • Constructor Details

    • OtelSpanWrapper

      public OtelSpanWrapper(@NotNull @NotNull io.opentelemetry.sdk.trace.ReadWriteSpan span, @NotNull @NotNull io.sentry.IScopes scopes, @NotNull @NotNull io.sentry.SentryDate startTimestamp, @Nullable @Nullable io.sentry.TracesSamplingDecision samplingDecision, @Nullable @Nullable io.sentry.opentelemetry.IOtelSpanWrapper parentSpan, @Nullable @Nullable io.sentry.SpanId parentSpanId, @Nullable @Nullable io.sentry.Baggage baggage)
  • Method Details

    • startChild

      @NotNull public @NotNull io.sentry.ISpan startChild(@NotNull @NotNull String operation)
      Specified by:
      startChild in interface io.sentry.ISpan
    • startChild

      @NotNull public @NotNull io.sentry.ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @NotNull @NotNull io.sentry.SpanOptions spanOptions)
      Specified by:
      startChild in interface io.sentry.ISpan
    • startChild

      @NotNull public @NotNull io.sentry.ISpan startChild(@NotNull @NotNull io.sentry.SpanContext spanContext, @NotNull @NotNull io.sentry.SpanOptions spanOptions)
      Specified by:
      startChild in interface io.sentry.ISpan
    • startChild

      @NotNull public @NotNull io.sentry.ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @Nullable @Nullable io.sentry.SentryDate timestamp, @NotNull @NotNull io.sentry.Instrumenter instrumenter)
      Specified by:
      startChild in interface io.sentry.ISpan
    • startChild

      @NotNull public @NotNull io.sentry.ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @Nullable @Nullable io.sentry.SentryDate timestamp, @NotNull @NotNull io.sentry.Instrumenter instrumenter, @NotNull @NotNull io.sentry.SpanOptions spanOptions)
      Specified by:
      startChild in interface io.sentry.ISpan
    • startChild

      @NotNull public @NotNull io.sentry.ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description)
      Specified by:
      startChild in interface io.sentry.ISpan
    • toSentryTrace

      @NotNull public @NotNull io.sentry.SentryTraceHeader toSentryTrace()
      Specified by:
      toSentryTrace in interface io.sentry.ISpan
    • getOpenTelemetrySpanAttributes

      @Internal @Nullable public @Nullable io.opentelemetry.api.common.Attributes getOpenTelemetrySpanAttributes()
      Specified by:
      getOpenTelemetrySpanAttributes in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • traceContext

      @Nullable public @Nullable io.sentry.TraceContext traceContext()
      Specified by:
      traceContext in interface io.sentry.ISpan
    • toBaggageHeader

      @Nullable public @Nullable io.sentry.BaggageHeader toBaggageHeader(@Nullable @Nullable List<String> thirdPartyBaggageHeaders)
      Specified by:
      toBaggageHeader in interface io.sentry.ISpan
    • finish

      public void finish()
      Specified by:
      finish in interface io.sentry.ISpan
    • finish

      public void finish(@Nullable @Nullable io.sentry.SpanStatus status)
      Specified by:
      finish in interface io.sentry.ISpan
    • finish

      public void finish(@Nullable @Nullable io.sentry.SpanStatus status, @Nullable @Nullable io.sentry.SentryDate timestamp)
      Specified by:
      finish in interface io.sentry.ISpan
    • setOperation

      public void setOperation(@NotNull @NotNull String operation)
      Specified by:
      setOperation in interface io.sentry.ISpan
    • getOperation

      @NotNull public @NotNull String getOperation()
      Specified by:
      getOperation in interface io.sentry.ISpan
    • setDescription

      public void setDescription(@Nullable @Nullable String description)
      Specified by:
      setDescription in interface io.sentry.ISpan
    • getDescription

      @Nullable public @Nullable String getDescription()
      Specified by:
      getDescription in interface io.sentry.ISpan
    • setStatus

      public void setStatus(@Nullable @Nullable io.sentry.SpanStatus status)
      Specified by:
      setStatus in interface io.sentry.ISpan
    • getStatus

      @Nullable public @Nullable io.sentry.SpanStatus getStatus()
      Specified by:
      getStatus in interface io.sentry.ISpan
    • setThrowable

      public void setThrowable(@Nullable @Nullable Throwable throwable)
      Specified by:
      setThrowable in interface io.sentry.ISpan
    • getThrowable

      @Nullable public @Nullable Throwable getThrowable()
      Specified by:
      getThrowable in interface io.sentry.ISpan
    • getSpanContext

      @NotNull public @NotNull io.sentry.SpanContext getSpanContext()
      Specified by:
      getSpanContext in interface io.sentry.ISpan
    • setTag

      public void setTag(@Nullable @Nullable String key, @Nullable @Nullable String value)
      Specified by:
      setTag in interface io.sentry.ISpan
    • getTag

      @Nullable public @Nullable String getTag(@Nullable @Nullable String key)
      Specified by:
      getTag in interface io.sentry.ISpan
    • getTags

      @Internal @NotNull public @NotNull Map<String,String> getTags()
      Specified by:
      getTags in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • isFinished

      public boolean isFinished()
      Specified by:
      isFinished in interface io.sentry.ISpan
    • setData

      public void setData(@Nullable @Nullable String key, @Nullable @Nullable Object value)
      Specified by:
      setData in interface io.sentry.ISpan
    • getData

      @Nullable public @Nullable Object getData(@Nullable @Nullable String key)
      Specified by:
      getData in interface io.sentry.ISpan
    • setMeasurement

      public void setMeasurement(@NotNull @NotNull String name, @NotNull @NotNull Number value)
      Specified by:
      setMeasurement in interface io.sentry.ISpan
    • setMeasurement

      public void setMeasurement(@NotNull @NotNull String name, @NotNull @NotNull Number value, @NotNull @NotNull io.sentry.MeasurementUnit unit)
      Specified by:
      setMeasurement in interface io.sentry.ISpan
    • updateEndDate

      public boolean updateEndDate(@NotNull @NotNull io.sentry.SentryDate date)
      Specified by:
      updateEndDate in interface io.sentry.ISpan
    • getStartDate

      @NotNull public @NotNull io.sentry.SentryDate getStartDate()
      Specified by:
      getStartDate in interface io.sentry.ISpan
    • getFinishDate

      @Nullable public @Nullable io.sentry.SentryDate getFinishDate()
      Specified by:
      getFinishDate in interface io.sentry.ISpan
    • isNoOp

      public boolean isNoOp()
      Specified by:
      isNoOp in interface io.sentry.ISpan
    • setContext

      public void setContext(@Nullable @Nullable String key, @Nullable @Nullable Object context)
      Specified by:
      setContext in interface io.sentry.ISpan
    • getContexts

      @NotNull public @NotNull io.sentry.protocol.Contexts getContexts()
      Specified by:
      getContexts in interface io.sentry.ISpan
    • setTransactionName

      public void setTransactionName(@NotNull @NotNull String name)
      Specified by:
      setTransactionName in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • setTransactionName

      public void setTransactionName(@NotNull @NotNull String name, @NotNull @NotNull io.sentry.protocol.TransactionNameSource nameSource)
      Specified by:
      setTransactionName in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • getTransactionNameSource

      @Internal @Nullable public @Nullable io.sentry.protocol.TransactionNameSource getTransactionNameSource()
      Specified by:
      getTransactionNameSource in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • getTransactionName

      @Internal @Nullable public @Nullable String getTransactionName()
      Specified by:
      getTransactionName in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • getTraceId

      @NotNull public @NotNull io.sentry.protocol.SentryId getTraceId()
      Specified by:
      getTraceId in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • getData

      @NotNull public @NotNull Map<String,Object> getData()
      Specified by:
      getData in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • getMeasurements

      @NotNull public @NotNull Map<String,io.sentry.protocol.MeasurementValue> getMeasurements()
      Specified by:
      getMeasurements in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • isSampled

      @Nullable public @Nullable Boolean isSampled()
      Specified by:
      isSampled in interface io.sentry.ISpan
    • isProfileSampled

      @Nullable public @Nullable Boolean isProfileSampled()
      Specified by:
      isProfileSampled in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • getSamplingDecision

      @Nullable public @Nullable io.sentry.TracesSamplingDecision getSamplingDecision()
      Specified by:
      getSamplingDecision in interface io.sentry.ISpan
    • getScopes

      @Internal @NotNull public @NotNull io.sentry.IScopes getScopes()
      Specified by:
      getScopes in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • storeInContext

      @NotNull public @NotNull io.opentelemetry.context.Context storeInContext(io.opentelemetry.context.Context context)
      Specified by:
      storeInContext in interface io.sentry.opentelemetry.IOtelSpanWrapper
    • makeCurrent

      @Internal @NotNull public @NotNull io.sentry.ISentryLifecycleToken makeCurrent()
      Specified by:
      makeCurrent in interface io.sentry.ISpan