File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
opentelemetry-sdk/src/trace Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -497,12 +497,15 @@ impl BatchSpanProcessor {
497497 return OTelSdkResult :: Ok ( ( ) ) ;
498498 }
499499
500+ // Splitting off batch clears the existing batch capacity, and is ready
501+ // for re-use in the next export. The newly returned vec! from split_off
502+ // is passed to the exporter.
503+ // TODO: Compared to Logs, this requires new allocation for vec for
504+ // every export. See if this can be optimized by
505+ // *not* requiring ownership in the exporter.
500506 let export = exporter. export ( batch. split_off ( 0 ) ) ;
501507 let export_result = futures_executor:: block_on ( export) ;
502508
503- // Clear the batch vec after exporting
504- batch. clear ( ) ;
505-
506509 match export_result {
507510 Ok ( _) => OTelSdkResult :: Ok ( ( ) ) ,
508511 Err ( err) => {
You can’t perform that action at this time.
0 commit comments