Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a DelegatingSpanData that can be used to wrap SpanData with different data. #1507

Closed
wants to merge 2 commits into from

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Aug 5, 2020

Alternative to #1502.

It's unfortunate since it means we have three implementations of SpanData - SpanWrapper, TestSpanData, DecoratingSpanData. Perhaps it allows squeezing a bit of performance but wonder if the wrapping concept is really worth it here in the first place.

Fixes #1321

/cc @iNikem

@anuraaga anuraaga changed the title @anuraaga Add a DelegatingSpanData that can be used to wrap SpanData with different data. Add a DelegatingSpanData that can be used to wrap SpanData with different data. Aug 5, 2020
* Attributes.Builder newAttributes = Attributes.newBuilder();
* delegate.getAttributes().forEach(newAttributes::setAttribute);
* newAttributes.setAttribute("client_type", clientType);
* attributes = newAttributes.build();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this was what I was thinking, @iNikem . It's not super pretty, but could be made much nicer with a toBuilder on the Attributes class, like we have on Labels.

@anuraaga anuraaga closed this Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow exporters to decorate SpanData
2 participants