Closed
Description
Attributes attached to a SpanBuilder
are currently stored as a Vec<opentelemetry::KeyValue>
- see docs.
This makes it impossible to access the value attached to a specific key or to verify that an attribute is present in O(1). It always take O(n), where n is the number of attributes - this can be significant.
Why was a Vec<KeyValue>
chosen over a HashMap<Key, Value>
?
I see it gets later processed into an EvictedHashMap
when SpanBuilder
gets converted into a Span
🤔