TraceSpan

interface TraceSpan : Scope

Represents a single operation/task within a trace. Each trace contains a root span and optionally one or more child spans.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val spanContext: SpanContext

The immutable tracing context this span belongs to

Functions

Link copied to clipboard
open fun asContextElement(): <Error class: unknown class>

A representation of this span as a CoroutineContext element

Link copied to clipboard
abstract fun close()

Marks the end of this span's execution. This MUST be called when the unit of work the span represents has finished.

Link copied to clipboard
abstract fun emitEvent(name: String, attributes: <Error class: unknown class> = emptyAttributes())

Add an event to this span

Link copied to clipboard
abstract fun mergeAttributes(attributes: <Error class: unknown class>)

Merge all attributes from attributes into this span's attributes (overriding any previously set values with the same keys).

Link copied to clipboard
abstract operator fun <T : Any> set(key: <Error class: unknown class><T>, value: T)

Set an attribute on the span

Link copied to clipboard
abstract fun setStatus(status: SpanStatus)

Set the span status

Inherited functions

Link copied to clipboard

Set common error attributes from an exception

Link copied to clipboard
fun <T : Any> TraceSpan.setAttribute(key: String, value: T)

Set an attribute on the span using a string key