Skip to content

Commit c7e47de

Browse files
cijothomaslalitb
andauthored
chore: modify BatchLogProcessor method to accept max_export_size: usize parameter instead of config: &BatchConfig (#3119)
Co-authored-by: Lalit Kumar Bhasin <[email protected]>
1 parent 1106b0f commit c7e47de

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

opentelemetry-sdk/src/logs/batch_log_processor.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ impl BatchLogProcessor {
360360
logs: &mut Vec<LogsData>,
361361
last_export_time: &mut Instant,
362362
current_batch_size: &AtomicUsize,
363-
config: &BatchConfig,
363+
max_export_size: usize,
364364
) -> OTelSdkResult
365365
where
366366
E: LogExporter + Send + Sync + 'static,
@@ -373,7 +373,7 @@ impl BatchLogProcessor {
373373
// Get upto `max_export_batch_size` amount of logs log records from the channel and push them to the logs vec
374374
while let Ok(log) = logs_receiver.try_recv() {
375375
logs.push(log);
376-
if logs.len() == config.max_export_batch_size {
376+
if logs.len() == max_export_size {
377377
break;
378378
}
379379
}
@@ -409,7 +409,7 @@ impl BatchLogProcessor {
409409
&mut logs,
410410
&mut last_export_time,
411411
&current_batch_size,
412-
&config,
412+
max_export_batch_size,
413413
);
414414
}
415415
Ok(BatchMessage::ForceFlush(sender)) => {
@@ -420,7 +420,7 @@ impl BatchLogProcessor {
420420
&mut logs,
421421
&mut last_export_time,
422422
&current_batch_size,
423-
&config,
423+
max_export_batch_size,
424424
);
425425
let _ = sender.send(result);
426426
}
@@ -432,7 +432,7 @@ impl BatchLogProcessor {
432432
&mut logs,
433433
&mut last_export_time,
434434
&current_batch_size,
435-
&config,
435+
max_export_batch_size,
436436
);
437437
let _ = exporter.shutdown();
438438
let _ = sender.send(result);
@@ -460,7 +460,7 @@ impl BatchLogProcessor {
460460
&mut logs,
461461
&mut last_export_time,
462462
&current_batch_size,
463-
&config,
463+
max_export_batch_size,
464464
);
465465
}
466466
Err(RecvTimeoutError::Disconnected) => {

0 commit comments

Comments
 (0)