Package io.sentry
Class NoOpTransaction
- java.lang.Object
-
- io.sentry.NoOpTransaction
-
- All Implemented Interfaces:
ISpan,ITransaction
public final class NoOpTransaction extends java.lang.Object implements ITransaction
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidfinish()Sets span timestamp marking this span as finished.voidfinish(@Nullable SpanStatus status)Sets span timestamp marking this span as finished.@NotNull ContextsgetContexts()Deprecated.@Nullable java.lang.ObjectgetData(@NotNull java.lang.String key)Returns extra data from span or transaction.@Nullable java.lang.StringgetDescription()Returns the span description.@NotNull SentryIdgetEventId()Returns transaction's event id.static NoOpTransactiongetInstance()@Nullable SpangetLatestActiveSpan()Returns the latest span that is not finished.@NotNull java.lang.StringgetName()Returns transaction name.@NotNull java.lang.StringgetOperation()Returns the span operation.@Nullable RequestgetRequest()Deprecated.@NotNull SpanContextgetSpanContext()Gets the span context.@NotNull java.util.List<Span>getSpans()@Nullable SpanStatusgetStatus()Returns the span status@Nullable java.lang.StringgetTag(@NotNull java.lang.String key)@Nullable java.lang.ThrowablegetThrowable()Gets the throwable that was thrown during the execution of the span.booleanisFinished()Returns if span has finished.@Nullable java.lang.BooleanisSampled()Returns if transaction is sampled.voidsetData(@NotNull java.lang.String key, @NotNull java.lang.Object value)Sets extra data on span or transaction.voidsetDescription(@Nullable java.lang.String description)Sets span description.voidsetName(@NotNull java.lang.String name)Sets transaction name.voidsetOperation(@NotNull java.lang.String operation)Sets span operation.voidsetRequest(@Nullable Request request)Deprecated.voidsetStatus(@Nullable SpanStatus status)Sets span status.voidsetTag(@NotNull java.lang.String key, @NotNull java.lang.String value)Sets the tag on span or transaction.voidsetThrowable(@Nullable java.lang.Throwable throwable)Sets the throwable that was thrown during the execution of the span.@NotNull ISpanstartChild(@NotNull java.lang.String operation)Starts a child Span.@NotNull ISpanstartChild(@NotNull java.lang.String operation, @Nullable java.lang.String description)Starts a child Span.@NotNull ISpanstartChild(@NotNull java.lang.String operation, @Nullable java.lang.String description, @Nullable java.util.Date timestamp)@NotNull SentryTraceHeadertoSentryTrace()Returns the trace information that could be sent as a sentry-trace header.@NotNull TraceStateHeadertoTraceStateHeader()Returns the trace state that can be sent as a "tracestate" header.@NotNull TraceStatetraceState()Returns the trace state information.
-
-
-
Method Detail
-
getInstance
public static NoOpTransaction getInstance()
-
setName
public void setName(@NotNull @NotNull java.lang.String name)Description copied from interface:ITransactionSets transaction name.- Specified by:
setNamein interfaceITransaction- Parameters:
name- - transaction name
-
getName
@NotNull public @NotNull java.lang.String getName()
Description copied from interface:ITransactionReturns transaction name.- Specified by:
getNamein interfaceITransaction- Returns:
- transaction name
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull java.lang.String operation)
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 java.lang.String operation, @Nullable @Nullable java.lang.String description, @Nullable @Nullable java.util.Date timestamp)
- Specified by:
startChildin interfaceISpan
-
startChild
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull java.lang.String operation, @Nullable @Nullable java.lang.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
-
setRequest
@Deprecated @ScheduledForRemoval public void setRequest(@Nullable @Nullable Request request)Deprecated.Description copied from interface:ITransactionAttaches request information to the transaction.- Specified by:
setRequestin interfaceITransaction- Parameters:
request- the request
-
getRequest
@Deprecated @ScheduledForRemoval @Nullable public @Nullable Request getRequest()
Deprecated.Description copied from interface:ITransactionReturns the request information from the transaction- Specified by:
getRequestin interfaceITransaction- Returns:
- the request or
nullif not set
-
getContexts
@Deprecated @ScheduledForRemoval @NotNull public @NotNull Contexts getContexts()
Deprecated.Description copied from interface:ITransactionReturns contexts associated with the transaction.- Specified by:
getContextsin interfaceITransaction- Returns:
- the contexts
-
getDescription
@Nullable public @Nullable java.lang.String getDescription()
Description copied from interface:ISpanReturns the span description.- Specified by:
getDescriptionin interfaceISpan- Returns:
- the description
-
getSpans
@NotNull public @NotNull java.util.List<Span> getSpans()
- Specified by:
getSpansin interfaceITransaction
-
getLatestActiveSpan
@Nullable public @Nullable 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
@NotNull public @NotNull SentryId getEventId()
Description copied from interface:ITransactionReturns transaction's event id.- Specified by:
getEventIdin interfaceITransaction- Returns:
- the event id
-
isFinished
public boolean isFinished()
Description copied from interface:ISpanReturns if span has finished.- Specified by:
isFinishedin interfaceISpan- Returns:
- if span has finished.
-
toSentryTrace
@NotNull public @NotNull SentryTraceHeader toSentryTrace()
Description copied from interface:ISpanReturns the trace information that could be sent as a sentry-trace header.- Specified by:
toSentryTracein interfaceISpan- Returns:
- SentryTraceHeader.
-
traceState
@NotNull public @NotNull TraceState traceState()
Description copied from interface:ISpanReturns the trace state information. @see Trace Context.- Specified by:
traceStatein interfaceISpan- Returns:
- a trace state or
nullifSentryOptions.isTraceSampling()is disabled.
-
toTraceStateHeader
@NotNull public @NotNull TraceStateHeader toTraceStateHeader()
Description copied from interface:ISpanReturns the trace state that can be sent as a "tracestate" header.- Specified by:
toTraceStateHeaderin interfaceISpan- Returns:
- TraceStateHeader or
nullifSentryOptions.isTraceSampling()is disabled.
-
finish
public void finish()
Description copied from interface:ISpanSets span timestamp marking this span as finished.
-
finish
public void finish(@Nullable @Nullable SpanStatus status)Description copied from interface:ISpanSets span timestamp marking this span as finished.
-
setOperation
public void setOperation(@NotNull @NotNull java.lang.String operation)Description copied from interface:ISpanSets span operation.- Specified by:
setOperationin interfaceISpan- Parameters:
operation- - the operation
-
getOperation
@NotNull public @NotNull java.lang.String getOperation()
Description copied from interface:ISpanReturns the span operation.- Specified by:
getOperationin interfaceISpan- Returns:
- the operation
-
setDescription
public void setDescription(@Nullable @Nullable java.lang.String description)Description copied from interface:ISpanSets span description.- Specified by:
setDescriptionin interfaceISpan- Parameters:
description- - the description.
-
setStatus
public void setStatus(@Nullable @Nullable SpanStatus status)Description copied from interface:ISpanSets span status.
-
getStatus
@Nullable public @Nullable SpanStatus getStatus()
Description copied from interface:ISpanReturns the span status
-
setThrowable
public void setThrowable(@Nullable @Nullable java.lang.Throwable throwable)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
@Nullable public @Nullable java.lang.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
@NotNull public @NotNull SpanContext getSpanContext()
Description copied from interface:ISpanGets the span context.- Specified by:
getSpanContextin interfaceISpan- Returns:
- the span context
-
setTag
public void setTag(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value)Description copied from interface:ISpanSets the tag on span or transaction.
-
getTag
@Nullable public @Nullable java.lang.String getTag(@NotNull @NotNull java.lang.String key)
-
isSampled
@Nullable public @Nullable java.lang.Boolean isSampled()
Description copied from interface:ITransactionReturns if transaction is sampled.- Specified by:
isSampledin interfaceITransaction- Returns:
- is sampled
-
setData
public void setData(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.Object value)Description copied from interface:ISpanSets extra data on span or transaction.
-
-