setSpanAttribute

fun <T : Any> setSpanAttribute(key: SpanAttributeKey<T>, value: T?)

Sets or removes a character span attribute for the given key. If value is null, the span attribute is removed from the specified range.