opentelemetry-rust
opentelemetry-rust copied to clipboard
Performance: send instrumentation library data to span processors once, not for every span when it ends
Similar to #1124, sdk::trace::Span::build_export_data clones the tracer's instrumentation library for every span processor and every span before sending it to the span processor.
There is an opportunity to optimize this by assigning identifiers to each instrumentation library, unique within the provider associated with each tracer, and communicating (id, instrumentation library) to each span processor when the tracer is created. Then, when each span ends, only the identifier of the instrumentation library needs to be sent to the span processor, rather than the full 120 bytes of instrumentation library data.
(I can work on a PR for this but wanted to hear of any objections here before starting that work.)