Package io.sentry
Class TransactionContext
java.lang.Object
io.sentry.SpanContext
io.sentry.TransactionContext
- All Implemented Interfaces:
JsonSerializable,JsonUnknown
-
Nested Class Summary
Nested classes/interfaces inherited from class io.sentry.SpanContext
SpanContext.Deserializer, SpanContext.JsonKeys -
Field Summary
FieldsFields inherited from class io.sentry.SpanContext
baggage, DEFAULT_ORIGIN, description, op, origin, status, tags, TYPE -
Constructor Summary
ConstructorsConstructorDescriptionTransactionContext(@NotNull SentryId traceId, @NotNull SpanId spanId, @Nullable SpanId parentSpanId, @Nullable TracesSamplingDecision parentSamplingDecision, @Nullable Baggage baggage) TransactionContext(@NotNull String name, @NotNull TransactionNameSource transactionNameSource, @NotNull String operation) TransactionContext(@NotNull String name, @NotNull TransactionNameSource transactionNameSource, @NotNull String operation, @Nullable TracesSamplingDecision samplingDecision) CreatesTransactionContextwith explicit sampling decision and name source.TransactionContext(@NotNull String name, @NotNull String operation) TransactionContext(@NotNull String name, @NotNull String operation, @Nullable TracesSamplingDecision samplingDecision) CreatesTransactionContextwith explicit sampling decision. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransactionContextfromPropagationContext(@NotNull PropagationContext propagationContext) static @NotNull TransactionContextfromSentryTrace(@NotNull String name, @NotNull String operation, @NotNull SentryTraceHeader sentryTrace) Deprecated.@NotNull StringgetName()@Nullable Boolean@Nullable TracesSamplingDecision@NotNull TransactionNameSourcebooleanWhether thisTransactionContextevaluates for the next app start.voidsetForNextAppStart(boolean forNextAppStart) voidvoidsetParentSampled(@Nullable Boolean parentSampled) voidsetParentSampled(@Nullable Boolean parentSampled, @Nullable Boolean parentProfileSampled) voidsetTransactionNameSource(@NotNull TransactionNameSource transactionNameSource) Methods inherited from class io.sentry.SpanContext
copyForChild, equals, getBaggage, getDescription, getInstrumenter, getOperation, getOrigin, getParentSpanId, getProfileSampled, getSampled, getSamplingDecision, getSpanId, getStatus, getTags, getTraceId, getUnknown, hashCode, serialize, setDescription, setInstrumenter, setOperation, setOrigin, setSampled, setSampled, setSamplingDecision, setStatus, setTag, setUnknown
-
Field Details
-
DEFAULT_TRANSACTION_NAME
- See Also:
-
-
Constructor Details
-
TransactionContext
-
TransactionContext
@Internal public TransactionContext(@NotNull @NotNull String name, @NotNull @NotNull TransactionNameSource transactionNameSource, @NotNull @NotNull String operation) -
TransactionContext
public TransactionContext(@NotNull @NotNull String name, @NotNull @NotNull String operation, @Nullable @Nullable TracesSamplingDecision samplingDecision) CreatesTransactionContextwith explicit sampling decision.- Parameters:
name- - transaction nameoperation- - operationsamplingDecision- - sampling decision
-
TransactionContext
@Internal public TransactionContext(@NotNull @NotNull String name, @NotNull @NotNull TransactionNameSource transactionNameSource, @NotNull @NotNull String operation, @Nullable @Nullable TracesSamplingDecision samplingDecision) CreatesTransactionContextwith explicit sampling decision and name source.- Parameters:
name- - transaction nameoperation- - operationsamplingDecision- - sampling decision
-
TransactionContext
@Internal public TransactionContext(@NotNull @NotNull SentryId traceId, @NotNull @NotNull SpanId spanId, @Nullable @Nullable SpanId parentSpanId, @Nullable @Nullable TracesSamplingDecision parentSamplingDecision, @Nullable @Nullable Baggage baggage)
-
-
Method Details
-
fromSentryTrace
@Deprecated @NotNull public static @NotNull TransactionContext fromSentryTrace(@NotNull @NotNull String name, @NotNull @NotNull String operation, @NotNull @NotNull SentryTraceHeader sentryTrace) Deprecated.useSentry.continueTrace(String, List)and setters for name and operation here instead.CreatesTransactionContextfrom sentry-trace header.- Parameters:
name- - the transaction nameoperation- - the operationsentryTrace- - the sentry-trace header- Returns:
- the transaction contexts
-
fromPropagationContext
@Internal public static TransactionContext fromPropagationContext(@NotNull @NotNull PropagationContext propagationContext) -
getName
-
getParentSampled
-
getParentSamplingDecision
-
setParentSampled
-
setParentSampled
-
getTransactionNameSource
-
setName
-
setTransactionNameSource
-
setForNextAppStart
@Internal public void setForNextAppStart(boolean forNextAppStart) -
isForNextAppStart
public boolean isForNextAppStart()Whether thisTransactionContextevaluates for the next app start. If this is true, it gets called only once when the SDK initializes. This is set only ifSentryOptions.isEnableAppStartProfiling()is true.- Returns:
- True if this
TransactionContextwill be used for the next app start.
-
Sentry.continueTrace(String, List)and setters for name and operation here instead.