Class TracingUtils

java.lang.Object
io.sentry.util.TracingUtils

public final class TracingUtils extends Object
  • Constructor Details

    • TracingUtils

      public TracingUtils()
  • Method Details

    • startNewTrace

      public static void startNewTrace(@NotNull @NotNull IScopes scopes)
    • traceIfAllowed

      @Nullable public static @Nullable TracingUtils.TracingHeaders traceIfAllowed(@NotNull @NotNull IScopes scopes, @NotNull @NotNull String requestUrl, @Nullable @Nullable List<String> thirdPartyBaggageHeaders, @Nullable @Nullable ISpan span)
    • trace

      @Nullable public static @Nullable TracingUtils.TracingHeaders trace(@NotNull @NotNull IScopes scopes, @Nullable @Nullable List<String> thirdPartyBaggageHeaders, @Nullable @Nullable ISpan span)
    • maybeUpdateBaggage

      @NotNull public static @NotNull PropagationContext maybeUpdateBaggage(@NotNull @NotNull IScope scope, @NotNull @NotNull SentryOptions sentryOptions)
    • isIgnored

      @Internal public static boolean isIgnored(@Nullable @Nullable List<FilterString> ignoredTransactions, @Nullable @Nullable String transactionName)
      Checks if a transaction is to be ignored.
    • ensureBaggage

      @Internal @NotNull public static @NotNull Baggage ensureBaggage(@Nullable @Nullable Baggage incomingBaggage, @Nullable @Nullable TracesSamplingDecision decision)
      Ensures a non null baggage instance is present by creating a new Baggage instance if null is passed in.

      Also ensures there is a sampleRand value present on the baggage if it is still mutable. If the baggage should be frozen, it also takes care of freezing it.

      Parameters:
      incomingBaggage - a nullable baggage instance, if null a new one will be created
      decision - a TracesSamplingDecision for potentially backfilling sampleRand to match that decision
      Returns:
      previous baggage instance or a new one
    • ensureBaggage

      @Internal @NotNull public static @NotNull Baggage ensureBaggage(@Nullable @Nullable Baggage incomingBaggage, @Nullable @Nullable Boolean decisionSampled, @Nullable @Nullable Double decisionSampleRate, @Nullable @Nullable Double decisionSampleRand)
      Ensures a non null baggage instance is present by creating a new Baggage instance if null is passed in.

      Also ensures there is a sampleRand value present on the baggage if it is still mutable. If the baggage should be frozen, it also takes care of freezing it.

      Parameters:
      incomingBaggage - a nullable baggage instance, if null a new one will be created
      decisionSampled - sampled decision for potential backfilling
      decisionSampleRate - sampleRate for potential backfilling
      decisionSampleRand - sampleRand to be used if none in baggage
      Returns:
      previous baggage instance or a new one