Package io.sentry

Class TransactionContext


  • public final class TransactionContext
    extends SpanContext
    • Constructor Detail

      • TransactionContext

        public TransactionContext​(@NotNull
                                  @NotNull java.lang.String name,
                                  @NotNull
                                  @NotNull java.lang.String operation)
      • TransactionContext

        public TransactionContext​(@NotNull
                                  @NotNull java.lang.String name,
                                  @NotNull
                                  @NotNull java.lang.String operation,
                                  @Nullable
                                  @Nullable java.lang.Boolean sampled)
        Creates TransactionContext with explicit sampling decision.
        Parameters:
        name - - transaction name
        operation - - operation
        sampled - - sampling decision
    • Method Detail

      • fromSentryTrace

        @NotNull
        public static @NotNull TransactionContext fromSentryTrace​(@NotNull
                                                                  @NotNull java.lang.String name,
                                                                  @NotNull
                                                                  @NotNull java.lang.String operation,
                                                                  @NotNull
                                                                  @NotNull SentryTraceHeader sentryTrace)
        Creates TransactionContext from sentry-trace header.
        Parameters:
        name - - the transaction name
        operation - - the operation
        sentryTrace - - the sentry-trace header
        Returns:
        the transaction contexts
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
      • getParentSampled

        @Nullable
        public @Nullable java.lang.Boolean getParentSampled()
      • setParentSampled

        public void setParentSampled​(@Nullable
                                     @Nullable java.lang.Boolean parentSampled)