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

fix(fielder): batch calls to SetAttributes #34

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Conversation

lizthegrey
Copy link
Member

@lizthegrey lizthegrey commented Jan 9, 2024

Which problem is this PR solving?

  • fielder.AddFields() is very inefficient, calling span.SetAttributes() once per field set. We can optimise/batch this.

image

Short description of the changes

@lizthegrey lizthegrey requested a review from a team as a code owner January 9, 2024 22:47
Copy link
Collaborator

@kentquirk kentquirk left a comment

Choose a reason for hiding this comment

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

Nice.

@lizthegrey lizthegrey merged commit e91c094 into main Jan 9, 2024
5 checks passed
@lizthegrey lizthegrey deleted the lizf.fielder-allocs branch January 9, 2024 23:02
lizthegrey added a commit that referenced this pull request Jan 9, 2024
## Which problem is this PR solving?

- `span.SetAttributes()` even with batching of the attributes in one
call from #34, will add them all to the inner `s.attributes` object one
at a time, causing excess `growslice` calls.

## Short description of the changes

- Cherry-picks in open-telemetry/opentelemetry-go#4818 for improved
performance.
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.

None yet

2 participants