Package io.sentry

Interface ITransaction

All Superinterfaces:
ISpan
All Known Implementing Classes:
NoOpTransaction, SentryTracer

public interface ITransaction extends ISpan
  • Method Details

    • setName

      void setName(@NotNull @NotNull String name)
      Sets transaction name.
      Parameters:
      name - - transaction name
    • setName

      @Internal void setName(@NotNull @NotNull String name, @NotNull @NotNull TransactionNameSource transactionNameSource)
    • getName

      @NotNull @NotNull String getName()
      Returns transaction name.
      Returns:
      transaction name
    • getTransactionNameSource

      @NotNull @NotNull TransactionNameSource getTransactionNameSource()
      Returns the source of the transaction name.
      Returns:
      transaction name source
    • getSpans

      @NotNull @TestOnly @NotNull List<Span> getSpans()
    • startChild

      @NotNull @NotNull ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @Nullable @Nullable SentryDate timestamp)
      Starts a child Span.
      Parameters:
      operation - - new span operation name
      description - - the span description
      timestamp - - the start timestamp of the span
      Returns:
      a new transaction span
    • isSampled

      @Nullable @Nullable Boolean isSampled()
      Returns if transaction is sampled.
      Returns:
      is sampled
    • isProfileSampled

      @Nullable @Nullable Boolean isProfileSampled()
      Returns if the profile of a transaction is sampled.
      Returns:
      profile is sampled
    • getSamplingDecision

      @Nullable @Nullable TracesSamplingDecision getSamplingDecision()
    • getLatestActiveSpan

      @Nullable @Nullable Span getLatestActiveSpan()
      Returns the latest span that is not finished.
      Returns:
      span or null if not found.
    • getEventId

      @NotNull @NotNull SentryId getEventId()
      Returns transaction's event id.
      Returns:
      the event id
    • scheduleFinish

      void scheduleFinish()
      Schedules when transaction should be automatically finished.
    • forceFinish

      @Internal void forceFinish(@NotNull @NotNull SpanStatus status, boolean dropIfNoChildren, @Nullable @Nullable Hint hint)
      Force finishes the transaction and it's child spans with the specified status. If the transaction is already finished this is a no-op.
      Parameters:
      status - The status to set the unfinished child spans / transaction to.
      dropIfNoChildren - true, if the transaction should be dropped when it e.g. contains no child spans. Usually true, but can be set to falseS for situations were the transaction and profile provide crucial context (e.g. ANRs)
      hint - An optional hint to pass down to the client/transport layer
    • finish

      @Internal void finish(@Nullable @Nullable SpanStatus status, @Nullable @Nullable SentryDate timestamp, boolean dropIfNoChildren, @Nullable @Nullable Hint hint)
    • setContext

      @Internal void setContext(@NotNull @NotNull String key, @NotNull @NotNull Object context)
    • getContexts

      @Internal @NotNull @NotNull Contexts getContexts()