setSpanAttribute

fun <T> setSpanAttribute(key: SpanAttributeKey<T>, value: T, range: IntRange = 0 until textLength)

Applies the specified character span attribute key and value to the given range. Any existing span attributes of the same key within this range are completely overwritten.