SpanBuilder

interface SpanBuilder

Builder for configuring and starting spans.

Since

0.4.0

Inheritors

Functions

Link copied to clipboard
abstract fun setAttribute(key: String, value: Boolean): SpanBuilder

Set a boolean attribute on the span.

abstract fun setAttribute(key: String, value: Double): SpanBuilder

Set a double attribute on the span.

abstract fun setAttribute(key: String, value: Long): SpanBuilder

Set a long attribute on the span.

abstract fun setAttribute(key: String, value: String): SpanBuilder

Set a string attribute on the span.

Link copied to clipboard
abstract fun setAttributes(attributes: Map<String, Any>): SpanBuilder

Set multiple attributes at once.

Link copied to clipboard
abstract fun setParent(context: SpanContext?): SpanBuilder

Set the parent span context.

Link copied to clipboard
abstract fun setSpanKind(kind: SpanKind): SpanBuilder

Set the span kind.

Link copied to clipboard
abstract fun setStartTimestamp(timestamp: Instant): SpanBuilder

Set explicit start timestamp (default is now).

Link copied to clipboard
abstract fun startSpan(): Span

Start and return the span.