SpanContext.
Spans are created by the SpanBuilder#startSpan method.
Span must be ended by calling end().
| Modifier and Type | Method and Description |
|---|---|
| public default Span | |
| public default Span | |
| public default Span | |
| public Span | Returns: this.the name of the event. name, Attributes the attributes that will be added; these are associated with this event, not
the attributes)Span as for setAttribute().Adds an event to the |
| public Span | Returns: this.the name of the event. name, Attributes the attributes that will be added; these are associated with this event, not
the attributes, long Span as for setAttribute().the explicit event timestamp since epoch. timestamp, TimeUnit the unit of the timestamp unit)Adds an event to the |
| public default Span | Returns: this.the name of the event. name, Attributes the attributes that will be added; these are associated with this event, not
the attributes, Instant Span as for setAttribute().the explicit event timestamp since epoch. timestamp)Adds an event to the |
| public default Span | Returns: this.the context of the linked spanContext)Span.Adds a link to this |
| public default Span | Returns: this.the context of the linked spanContext, Attributes Span.the attributes of the attributes)Link.Adds a link to this |
| public static Span | |
| public void | |
| public void | |
| public default void | |
| public static Span | fromContext(Context context)
Returns the |
| public static Span | fromContextOrNull(Context context)
Returns the |
| public static Span | |
| public SpanContext | Returns: theSpanContext associated with this Span.Returns the |
| public boolean | Returns: true if this Span records tracing events.Returns |
| public default Span | Returns: this.the exception)Throwable to record. |
| public Span | Returns: this.the exception, Attributes Throwable to record.the additional additionalAttributes)Attributes to record. |
| public default Span | |
| public default Span | Returns: this.the key for this attribute. key, String the value for this attribute. value)Sets an attribute to the |
| public default Span | Returns: this.the key for this attribute. key, long the value for this attribute. value)Sets an attribute to the |
| public default Span | Returns: this.the key for this attribute. key, double the value for this attribute. value)Sets an attribute to the |
| public default Span | Returns: this.the key for this attribute. key, boolean the value for this attribute. value)Sets an attribute to the |
| public <T> Span | Returns: this.the key for this attribute. key, T the value for this attribute. value)Sets an attribute to the |
| public default Span | Returns: this.the key for this attribute. key, int the value for this attribute. value)Sets an attribute to the |
| public default Span | |
| public Span | Returns: this.the statusCode, String StatusCode to set.the description of the description)Status.Sets the status to the |
| public default Context | storeInContext(Context context)
Implements io. Returns a new |
| public Span | |
| public static Span | wrap(SpanContext spanContext)
Returns a non-recording |
| addEvent | back to summary |
|---|---|
| public default Span addEvent(String name) Adds an event to the | |
| addEvent | back to summary |
|---|---|
| public default Span addEvent(String name, long timestamp, TimeUnit unit) Adds an event to the When possible, it is preferred to use | |
| addEvent | back to summary |
|---|---|
| public default Span addEvent(String name, Instant timestamp) Adds an event to the When possible, it is preferred to use | |
| addEvent | back to summary |
|---|---|
| public Span addEvent(String name, Attributes attributes) Adds an event to the
| |
| addEvent | back to summary |
|---|---|
| public Span addEvent(String name, Attributes attributes, long timestamp, TimeUnit unit) Adds an event to the When possible, it is preferred to use
| |
| addEvent | back to summary |
|---|---|
| public default Span addEvent(String name, Attributes attributes, Instant timestamp) Adds an event to the When possible, it is preferred to use
| |
| addLink | back to summary |
|---|---|
| public default Span addLink(SpanContext spanContext) Adds a link to this Links are used to link Implementations may ignore calls with an invalid span context. Callers should prefer to add links before starting the span via
| |
| addLink | back to summary |
|---|---|
| public default Span addLink(SpanContext spanContext, Attributes attributes) Adds a link to this Links are used to link Implementations may ignore calls with an invalid span context. Callers should prefer to add links before starting the span via
| |
| current | back to summary |
|---|---|
| public static Span current() Returns the | |
| end | back to summary |
|---|---|
| public void end() Marks the end of Only the timing of the first end call for a given | |
| end | back to summary |
|---|---|
| public void end(long timestamp, TimeUnit unit) Marks the end of Only the timing of the first end call for a given Use this method for specifying explicit end options, such as end
| |
| end | back to summary |
|---|---|
| public default void end(Instant timestamp) Marks the end of Only the timing of the first end call for a given Use this method for specifying explicit end options, such as end
| |
| fromContext | back to summary |
|---|---|
| public static Span fromContext(Context context) Returns the | |
| fromContextOrNull | back to summary |
|---|---|
| public static Span fromContextOrNull(Context context) Returns the
| |
| getInvalid | back to summary |
|---|---|
| public static Span getInvalid() Returns an invalid | |
| getSpanContext | back to summary |
|---|---|
| public SpanContext getSpanContext() Returns the
| |
| isRecording | back to summary |
|---|---|
| public boolean isRecording() Returns
| |
| recordException | back to summary |
|---|---|
| public default Span recordException(Throwable exception) Records information about the Note that the EXCEPTION_ESCAPED value from the Semantic Conventions cannot be determined by
this function. You should record this attribute manually using | |
| recordException | back to summary |
|---|---|
| public Span recordException(Throwable exception, Attributes additionalAttributes) Records information about the
| |
| setAllAttributes | back to summary |
|---|---|
| public default Span setAllAttributes(Attributes attributes) Sets attributes to the
| |
| setAttribute | back to summary |
|---|---|
| public default Span setAttribute(String key, String value) Sets an attribute to the Empty String "" and null are valid attribute Note It is strongly recommended to use | |
| setAttribute | back to summary |
|---|---|
| public default Span setAttribute(String key, long value) Sets an attribute to the Note It is strongly recommended to use | |
| setAttribute | back to summary |
|---|---|
| public default Span setAttribute(String key, double value) Sets an attribute to the Note It is strongly recommended to use | |
| setAttribute | back to summary |
|---|---|
| public default Span setAttribute(String key, boolean value) Sets an attribute to the Note It is strongly recommended to use | |
| setAttribute | back to summary |
|---|---|
| public <T> Span setAttribute(AttributeKey<T> key, T value) Sets an attribute to the Note the behavior of null values is undefined, and hence strongly discouraged.
| |
| setAttribute | back to summary |
|---|---|
| public default Span setAttribute(AttributeKey<Long> key, int value) Sets an attribute to the
| |
| setStatus | back to summary |
|---|---|
| public default Span setStatus(StatusCode statusCode) Sets the status to the If used, this will override the default Only the value of the last call will be recorded, and implementations are free to ignore previous calls.
| |
| setStatus | back to summary |
|---|---|
| public Span setStatus(StatusCode statusCode, String description) Sets the status to the If used, this will override the default Only the value of the last call will be recorded, and implementations are free to ignore previous calls.
| |
| storeInContext | back to summary |
|---|---|
| public default Context storeInContext(Context context) Implements io. Doc from io. Returns a new
| |
| updateName | back to summary |
|---|---|
| public Span updateName(String name) Updates the If used, this will override the name provided via Upon this update, any sampling behavior based on | |
| wrap | back to summary |
|---|---|
| public static Span wrap(SpanContext spanContext) Returns a non-recording | |