Package io.sentry
Interface ITransaction
- All Superinterfaces:
ISpan
- All Known Implementing Classes:
NoOpTransaction
,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 Contexts
@NotNull SentryId
Returns transaction's event id.@Nullable Span
Returns the latest span that is not finished.@NotNull String
getName()
Returns transaction name.@Nullable TracesSamplingDecision
getSpans()
@NotNull TransactionNameSource
Returns the source of the transaction name.@Nullable Boolean
Returns if the profile of a transaction is sampled.@Nullable Boolean
Returns if transaction is sampled.void
Schedules when transaction should be automatically finished.void
setContext
(@NotNull String key, @NotNull Object context) 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, getData, getDescription, getFinishDate, getLocalMetricsAggregator, getOperation, getSpanContext, getStartDate, getStatus, getTag, getThrowable, isFinished, isNoOp, setData, setDescription, setMeasurement, setMeasurement, setOperation, setStatus, setTag, setThrowable, 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
-
isSampled
Returns if transaction is sampled.- Returns:
- is sampled
-
isProfileSampled
Returns if the profile of a transaction is sampled.- Returns:
- profile is sampled
-
getSamplingDecision
-
getLatestActiveSpan
Returns the latest span that is not finished.- Returns:
- span or null if not found.
-
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
-
getContexts
-