Package io.sentry
Interface ITransaction
- All Superinterfaces:
ISpan
- All Known Implementing Classes:
NoOpTransaction
,OtelTransactionSpanForwarder
,SentryTracer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
finish
(@Nullable SpanStatus status, @Nullable SentryDate timestamp, boolean dropIfNoChildren, @Nullable Hint hint) void
forceFinish
(@NotNull SpanStatus status, boolean dropIfNoChildren, @Nullable Hint hint) Force finishes the transaction and it's child spans with the specified status.@NotNull SentryId
@Nullable ISpan
Returns the latest span that is not finished.@NotNull String
getName()
Returns transaction name.getSpans()
@NotNull TransactionNameSource
Returns the source of the transaction name.@Nullable Boolean
Returns if the profile of a transaction is sampled.void
Schedules when transaction should be automatically finished.void
Sets transaction name.void
setName
(@NotNull String name, @NotNull TransactionNameSource transactionNameSource) @NotNull ISpan
startChild
(@NotNull String operation, @Nullable String description, @Nullable SentryDate timestamp) Starts a child Span.Methods inherited from interface io.sentry.ISpan
finish, finish, finish, getContexts, getData, getDescription, getFinishDate, getOperation, getSamplingDecision, getSpanContext, getStartDate, getStatus, getTag, getThrowable, isFinished, isNoOp, isSampled, makeCurrent, setContext, setData, setDescription, setMeasurement, setMeasurement, setOperation, setStatus, setTag, setThrowable, startChild, startChild, startChild, startChild, startChild, startChild, toBaggageHeader, toSentryTrace, traceContext, updateEndDate
-
Method Details
-
setName
Sets transaction name.- Parameters:
name
- - transaction name
-
setName
@Internal void setName(@NotNull @NotNull String name, @NotNull @NotNull TransactionNameSource transactionNameSource) -
getName
Returns transaction name.- Returns:
- transaction name
-
getTransactionNameSource
Returns the source of the transaction name.- Returns:
- transaction name source
-
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 namedescription
- - the span descriptiontimestamp
- - the start timestamp of the span- Returns:
- a new transaction span
-
isProfileSampled
Returns if the profile of a transaction is sampled.- Returns:
- profile is sampled
-
getLatestActiveSpan
Returns the latest span that is not finished.- Returns:
- span or null if not found.
-
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) -
getEventId
-