public final class Span extends SpanContext implements ISpan
description, op, status, tags, TYPE
Modifier and Type | Method and Description |
---|---|
void |
finish()
Sets span timestamp marking this span as finished.
|
void |
finish(@Nullable SpanStatus status)
Sets span timestamp marking this span as finished.
|
@NotNull SpanContext |
getSpanContext()
Gets the span context.
|
@NotNull java.util.Date |
getStartTimestamp() |
@Nullable java.lang.Throwable |
getThrowable()
Gets the throwable that was thrown during the execution of the span.
|
@Nullable java.util.Date |
getTimestamp() |
boolean |
isFinished()
Returns if span has finished.
|
void |
setThrowable(@Nullable java.lang.Throwable throwable)
Sets the throwable that was thrown during the execution of the span.
|
@NotNull ISpan |
startChild(@NotNull java.lang.String operation)
Starts a child Span.
|
@NotNull ISpan |
startChild(@NotNull java.lang.String operation,
@Nullable java.lang.String description)
Starts a child Span.
|
@NotNull SentryTraceHeader |
toSentryTrace()
Returns a string that could be sent as a sentry-trace header.
|
clone, getDescription, getOperation, getParentSpanId, getSampled, getSpanId, getStatus, getTags, getTraceId, setDescription, setOperation, setStatus, setTag
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getOperation, getStatus, setDescription, setOperation, setStatus, setTag
@NotNull public @NotNull java.util.Date getStartTimestamp()
@Nullable public @Nullable java.util.Date getTimestamp()
@NotNull public @NotNull ISpan startChild(@NotNull @NotNull java.lang.String operation)
ISpan
startChild
in interface ISpan
operation
- - new span operation name@NotNull public @NotNull ISpan startChild(@NotNull @NotNull java.lang.String operation, @Nullable @Nullable java.lang.String description)
ISpan
startChild
in interface ISpan
operation
- - new span operation namedescription
- - new span description name@NotNull public @NotNull SentryTraceHeader toSentryTrace()
ISpan
toSentryTrace
in interface ISpan
public void finish()
ISpan
public void finish(@Nullable @Nullable SpanStatus status)
ISpan
@NotNull public @NotNull SpanContext getSpanContext()
ISpan
getSpanContext
in interface ISpan
public boolean isFinished()
ISpan
isFinished
in interface ISpan
public void setThrowable(@Nullable @Nullable java.lang.Throwable throwable)
ISpan
setThrowable
in interface ISpan
throwable
- - the throwable.@Nullable public @Nullable java.lang.Throwable getThrowable()
ISpan
getThrowable
in interface ISpan
null
if none