Replies: 1 comment
-
We've discussed extending the Attribute consumer API quite a few times. One option is to provide a non-SMI API with methods to implement for each of the attribute types. Another would be to provide a SMI API that took a whole slew of But, yes, it might just be simpler to add a method to the span/builder to set all the Attributes at one go. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure how to quantify this but the API for reading attributes from a
ReadableSpan
feels a bit weird to me. Like the way that it's a wildcard generic API makes it tricky to use outside of simple scenarios.For example, I'm toying with a
SpanProcessor
that can copy the attributes from the parent span to the new span when it is started:I'd be interested in a solution that could avoid suppressing the unchecked warning.
I don't know if this is a use case that would be common enough to justify a new API. However, one that might be helpful could be a method on
Span
/SpanBuilder
calledsetAttributes
that accepts anAttributes
instance to be copied onto thatSpan
.Then the above code could be simplified to the following:
Beta Was this translation helpful? Give feedback.
All reactions