# SpanBuilder

interface SpanBuilder

A builder for creating and starting a Span.

## Functions

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

Sets a boolean attribute on the span.

abstract operator fun set(key: String, value: Double): SpanBuilder

Sets a double attribute on the span.

abstract operator fun set(key: String, value: Long): SpanBuilder

Sets a long attribute on the span.

abstract operator fun set(key: String, value: String): SpanBuilder

Sets a string attribute on the span.

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

Sets the parent context for this span.

startSpan
Link copied to clipboard
abstract fun startSpan(): Span

Starts and returns a new Span.