fielder.AddFields() is very inefficient, calling span.SetAttributes() once per field set. We can optimise/batch this.
Short description of the changes
Batches calls to span.SetAttributes() to ensure efficient memory allocations, decreasing garbage & growslice. Alternative to try first before pushing open-telemetry/opentelemetry-go#4818 forward.
Which problem is this PR solving?
fielder.AddFields()
is very inefficient, callingspan.SetAttributes()
once per field set. We can optimise/batch this.Short description of the changes
span.SetAttributes()
to ensure efficient memory allocations, decreasing garbage & growslice. Alternative to try first before pushing open-telemetry/opentelemetry-go#4818 forward.