Package io.sentry
Class NoOpTransaction
java.lang.Object
io.sentry.NoOpTransaction
- All Implemented Interfaces:
ISpan,ITransaction
-
Method Summary
Modifier and TypeMethodDescriptionvoidfinish()Sets span timestamp marking this span as finished.voidfinish(@Nullable SpanStatus status) Sets span timestamp marking this span as finished.voidfinish(@Nullable SpanStatus status, @Nullable SentryDate timestamp) Sets span timestamp marking this span as finished.voidfinish(@Nullable SpanStatus status, @Nullable SentryDate timestamp, boolean dropIfNoChildren, @Nullable Hint hint) voidforceFinish(@NotNull SpanStatus status, boolean dropIfNoChildren, @Nullable Hint hint) Force finishes the transaction and it's child spans with the specified status.@NotNull Contexts@Nullable ObjectReturns extra data from span or transaction.@Nullable StringReturns the span description.@NotNull SentryId@NotNull SentryDateReturns the end date of this span or transaction.static NoOpTransaction@Nullable ISpanReturns the latest span that is not finished.@NotNull StringgetName()Returns transaction name.@NotNull StringReturns the span operation.@Nullable TracesSamplingDecision@NotNull SpanContextGets the span context.getSpans()@NotNull SentryDateReturns the start date of this span or transaction.@Nullable SpanStatusReturns the span status@Nullable String@Nullable ThrowableGets the throwable that was thrown during the execution of the span.@NotNull TransactionNameSourceReturns the source of the transaction name.booleanReturns if span has finished.booleanisNoOp()Whether this span instance is a NOOP that doesn't collect information@Nullable BooleanReturns if the profile of a transaction is sampled.@Nullable Boolean@NotNull ISentryLifecycleTokenvoidSchedules when transaction should be automatically finished.voidsetContext(@NotNull String key, @NotNull Object context) voidSets extra data on span or transaction.voidsetDescription(@Nullable String description) Sets span description.voidsetMeasurement(@NotNull String name, @NotNull Number value) Set a measurement without unit.voidsetMeasurement(@NotNull String name, @NotNull Number value, @NotNull MeasurementUnit unit) Set a measurement with specific unit.voidSets transaction name.voidsetName(@NotNull String name, @NotNull TransactionNameSource transactionNameSource) voidsetOperation(@NotNull String operation) Sets span operation.voidsetStatus(@Nullable SpanStatus status) Sets span status.voidSets the tag on span or transaction.voidsetThrowable(@Nullable Throwable throwable) Sets the throwable that was thrown during the execution of the span.@NotNull ISpanstartChild(@NotNull SpanContext spanContext, @NotNull SpanOptions spanOptions) @NotNull ISpanstartChild(@NotNull String operation) Starts a child Span.@NotNull ISpanstartChild(@NotNull String operation, @Nullable String description) Starts a child Span.@NotNull ISpanstartChild(@NotNull String operation, @Nullable String description, @NotNull SpanOptions spanOptions) @NotNull ISpanstartChild(@NotNull String operation, @Nullable String description, @Nullable SentryDate timestamp) Starts a child Span.@NotNull ISpanstartChild(@NotNull String operation, @Nullable String description, @Nullable SentryDate timestamp, @NotNull Instrumenter instrumenter) @NotNull ISpanstartChild(@NotNull String operation, @Nullable String description, @Nullable SentryDate timestamp, @NotNull Instrumenter instrumenter, @NotNull SpanOptions spanOptions) @Nullable BaggageHeadertoBaggageHeader(@Nullable List<String> thirdPartyBaggageHeaders) Returns the baggage that can be sent as "baggage" header.@NotNull SentryTraceHeaderReturns the trace information that could be sent as a sentry-trace header.@NotNull TraceContextReturns the trace context.booleanupdateEndDate(@NotNull SentryDate date) Updates the end date of the span.
-
Method Details
-
getInstance
-
setName
Description copied from interface:ITransactionSets transaction name.- Specified by:
setNamein interfaceITransaction- Parameters:
name- - transaction name
-
setName
@Internal public void setName(@NotNull @NotNull String name, @NotNull @NotNull TransactionNameSource transactionNameSource) - Specified by:
setNamein interfaceITransaction
-
getName
Description copied from interface:ITransactionReturns transaction name.- Specified by:
getNamein interfaceITransaction- Returns:
- transaction name
-
getTransactionNameSource
Description copied from interface:ITransactionReturns the source of the transaction name.- Specified by:
getTransactionNameSourcein interfaceITransaction- Returns:
- transaction name source
-
startChild
Description copied from interface:ISpanStarts a child Span.- Specified by:
startChildin interfaceISpan- Parameters:
operation- - new span operation name- Returns:
- a new transaction span
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @NotNull @NotNull SpanOptions spanOptions) - Specified by:
startChildin interfaceISpan
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull SpanContext spanContext, @NotNull @NotNull SpanOptions spanOptions) - Specified by:
startChildin interfaceISpan
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @Nullable @Nullable SentryDate timestamp, @NotNull @NotNull Instrumenter instrumenter) - Specified by:
startChildin interfaceISpan
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @Nullable @Nullable SentryDate timestamp, @NotNull @NotNull Instrumenter instrumenter, @NotNull @NotNull SpanOptions spanOptions) - Specified by:
startChildin interfaceISpan
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description) Description copied from interface:ISpanStarts a child Span.- Specified by:
startChildin interfaceISpan- Parameters:
operation- - new span operation namedescription- - new span description name- Returns:
- a new transaction span
-
getDescription
Description copied from interface:ISpanReturns the span description.- Specified by:
getDescriptionin interfaceISpan- Returns:
- the description
-
getSpans
- Specified by:
getSpansin interfaceITransaction
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull String operation, @Nullable @Nullable String description, @Nullable @Nullable SentryDate timestamp) Description copied from interface:ITransactionStarts a child Span.- Specified by:
startChildin interfaceITransaction- Parameters:
operation- - new span operation namedescription- - the span descriptiontimestamp- - the start timestamp of the span- Returns:
- a new transaction span
-
getLatestActiveSpan
Description copied from interface:ITransactionReturns the latest span that is not finished.- Specified by:
getLatestActiveSpanin interfaceITransaction- Returns:
- span or null if not found.
-
getEventId
- Specified by:
getEventIdin interfaceITransaction
-
makeCurrent
- Specified by:
makeCurrentin interfaceISpan
-
scheduleFinish
public void scheduleFinish()Description copied from interface:ITransactionSchedules when transaction should be automatically finished.- Specified by:
scheduleFinishin interfaceITransaction
-
forceFinish
public void forceFinish(@NotNull @NotNull SpanStatus status, boolean dropIfNoChildren, @Nullable @Nullable Hint hint) Description copied from interface:ITransactionForce finishes the transaction and it's child spans with the specified status. If the transaction is already finished this is a no-op.- Specified by:
forceFinishin interfaceITransaction- 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
public void finish(@Nullable @Nullable SpanStatus status, @Nullable @Nullable SentryDate timestamp, boolean dropIfNoChildren, @Nullable @Nullable Hint hint) - Specified by:
finishin interfaceITransaction
-
isFinished
public boolean isFinished()Description copied from interface:ISpanReturns if span has finished.- Specified by:
isFinishedin interfaceISpan- Returns:
- if span has finished.
-
toSentryTrace
Description copied from interface:ISpanReturns the trace information that could be sent as a sentry-trace header.- Specified by:
toSentryTracein interfaceISpan- Returns:
- SentryTraceHeader.
-
traceContext
Description copied from interface:ISpanReturns the trace context.- Specified by:
traceContextin interfaceISpan- Returns:
- a trace context or
nullifSentryOptions.isTraceSampling()is disabled.
-
toBaggageHeader
@Nullable public @Nullable BaggageHeader toBaggageHeader(@Nullable @Nullable List<String> thirdPartyBaggageHeaders) Description copied from interface:ISpanReturns the baggage that can be sent as "baggage" header.- Specified by:
toBaggageHeaderin interfaceISpan- Returns:
- BaggageHeader or
nullifSentryOptions.isTraceSampling()is disabled.
-
finish
public void finish()Description copied from interface:ISpanSets span timestamp marking this span as finished. -
finish
Description copied from interface:ISpanSets span timestamp marking this span as finished. -
finish
Description copied from interface:ISpanSets span timestamp marking this span as finished. -
setOperation
Description copied from interface:ISpanSets span operation.- Specified by:
setOperationin interfaceISpan- Parameters:
operation- - the operation
-
getOperation
Description copied from interface:ISpanReturns the span operation.- Specified by:
getOperationin interfaceISpan- Returns:
- the operation
-
setDescription
Description copied from interface:ISpanSets span description.- Specified by:
setDescriptionin interfaceISpan- Parameters:
description- - the description.
-
setStatus
Description copied from interface:ISpanSets span status. -
getStatus
Description copied from interface:ISpanReturns the span status -
setThrowable
Description copied from interface:ISpanSets the throwable that was thrown during the execution of the span.- Specified by:
setThrowablein interfaceISpan- Parameters:
throwable- - the throwable.
-
getThrowable
Description copied from interface:ISpanGets the throwable that was thrown during the execution of the span.- Specified by:
getThrowablein interfaceISpan- Returns:
- throwable or
nullif none
-
getSpanContext
Description copied from interface:ISpanGets the span context.- Specified by:
getSpanContextin interfaceISpan- Returns:
- the span context
-
setTag
Description copied from interface:ISpanSets the tag on span or transaction. -
getTag
-
isSampled
-
isProfileSampled
Description copied from interface:ITransactionReturns if the profile of a transaction is sampled.- Specified by:
isProfileSampledin interfaceITransaction- Returns:
- profile is sampled
-
getSamplingDecision
- Specified by:
getSamplingDecisionin interfaceISpan
-
setData
Description copied from interface:ISpanSets extra data on span or transaction. -
getData
Description copied from interface:ISpanReturns extra data from span or transaction. -
setMeasurement
Description copied from interface:ISpanSet a measurement without unit. When setting the measurement without the unit, no formatting will be applied to the measurement value in the Sentry product, and the value will be shown as is.NOTE: Setting a measurement with the same name on the same transaction multiple times only keeps the last value.
- Specified by:
setMeasurementin interfaceISpan- Parameters:
name- the name of the measurementvalue- the value of the measurement
-
setMeasurement
public void setMeasurement(@NotNull @NotNull String name, @NotNull @NotNull Number value, @NotNull @NotNull MeasurementUnit unit) Description copied from interface:ISpanSet a measurement with specific unit.NOTE: Setting a measurement with the same name on the same transaction multiple times only keeps the last value.
- Specified by:
setMeasurementin interfaceISpan- Parameters:
name- the name of the measurementvalue- the value of the measurementunit- the unit the value is measured in
-
setContext
- Specified by:
setContextin interfaceISpan
-
getContexts
- Specified by:
getContextsin interfaceISpan
-
updateEndDate
Description copied from interface:ISpanUpdates the end date of the span. Note: This will only update the end date if the span is already finished.- Specified by:
updateEndDatein interfaceISpan- Parameters:
date- the end date to set- Returns:
- true if the end date was updated, false otherwise
-
getStartDate
Description copied from interface:ISpanReturns the start date of this span or transaction.- Specified by:
getStartDatein interfaceISpan- Returns:
- the start date
-
getFinishDate
Description copied from interface:ISpanReturns the end date of this span or transaction.- Specified by:
getFinishDatein interfaceISpan- Returns:
- the end date
-
isNoOp
public boolean isNoOp()Description copied from interface:ISpanWhether this span instance is a NOOP that doesn't collect information
-