Skip to content

Performance: send resource data to span processors once, not for every span when it ends #1124

@shaun-cox

Description

@shaun-cox

sdk::trace::Span::ensure_ended_and_exported clones the provider's config resource for every span processor and every span before sending it to the span processor.

But since the resource is unique to the provider which owns all the span processors, this data could be sent ahead of time, just once, to each span processor.

Not only would this reduce CPU consumption by not cloning, but it will also reduce the size of each message sent through a span processor channel by about 64 bytes (estimated) which will save CPU all by itself.

(I can work on a PR for this but wanted to hear of any objections here before starting that work.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-logArea: Issues related to logsA-metricsArea: issues related to metricsA-traceArea: issues related to tracingtriage:acceptedHas been triaged and accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions