NoOpSpan

object NoOpSpan : Span

No-op span implementation for when tracing is disabled or not sampled.

Since

0.4.0

Properties

Link copied to clipboard
open override val context: SpanContext

The span context containing trace/span IDs.

Functions

Link copied to clipboard
open override fun addEvent(name: String, attributes: Map<String, String> = emptyMap()): NoOpSpan

Add an event (annotation) to this span.

open override fun addEvent(name: String, timestamp: Instant, attributes: Map<String, String> = emptyMap()): NoOpSpan

Add an event with timestamp.

Link copied to clipboard
open override fun close()

Close is an alias for end() (for use with AutoCloseable).

Link copied to clipboard
open override fun end()

End this span with the current timestamp.

open override fun end(timestamp: Instant)

End this span with a specific timestamp.

Link copied to clipboard
open override fun isRecording(): Boolean

Check if this span is recording (not a no-op).

Link copied to clipboard
open override fun recordException(exception: Throwable): NoOpSpan

Record an exception on this span.

Link copied to clipboard
open override fun setAttribute(key: String, value: Boolean): NoOpSpan

Set a boolean attribute on this span.

open override fun setAttribute(key: String, value: Double): NoOpSpan

Set a double attribute on this span.

open override fun setAttribute(key: String, value: Long): NoOpSpan

Set a long attribute on this span.

open override fun setAttribute(key: String, value: String): NoOpSpan

Set a string attribute on this span.

Link copied to clipboard
open override fun setStatus(status: SpanStatus, description: String? = null): NoOpSpan

Set the status of this span.

Link copied to clipboard
open override fun updateName(name: String): NoOpSpan

Update the span name.