You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if you're writing a span processor and want to read all of a span's attributes, you need to first get an immutable copy of that span via ReadableSpan#toSpanData().
Oddly, ReadableSpan has a method for accessing a single attribute if you know the key ahead of time, but not all attributes. This seems to be a simple oversight. The specification states the following on Readable Span:
A function receiving this as argument MUST be able to access all information that was added to the span, as listed in the API spec for Span.
Given that accessors are available for many parts of the span, its odd that attributes are not accessible in the same way. Clearly the trick of converting toSpanData() first to access all fields was not the intended usage patter, else why have any direct accessors on ReadableSpan in the first place?
I propose we add Attributes getAttributes to ReadableSpan.
The text was updated successfully, but these errors were encountered:
Currently if you're writing a span processor and want to read all of a span's attributes, you need to first get an immutable copy of that span via ReadableSpan#toSpanData().
Oddly, ReadableSpan has a method for accessing a single attribute if you know the key ahead of time, but not all attributes. This seems to be a simple oversight. The specification states the following on Readable Span:
Given that accessors are available for many parts of the span, its odd that attributes are not accessible in the same way. Clearly the trick of converting
toSpanData()
first to access all fields was not the intended usage patter, else why have any direct accessors on ReadableSpan in the first place?I propose we add
Attributes getAttributes
to ReadableSpan.The text was updated successfully, but these errors were encountered: