Skip to content

Commit fa11cd7

Browse files
committed
initial commit
1 parent d1f3cbb commit fa11cd7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

opentelemetry-sdk/src/logs/log_processor.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,16 @@ impl<R: RuntimeChannel> LogProcessor for BatchLogProcessorWithAsyncRuntime<R> {
554554
}
555555

556556
fn shutdown(&self) -> LogResult<()> {
557+
let dropped_logs = self.dropped_logs_count.load(Ordering::Relaxed);
558+
let max_queue_size = self.max_queue_size;
559+
if dropped_logs > 0 {
560+
otel_warn!(
561+
name: "BatchLogProcessor.LogsDropped",
562+
dropped_logs_count = dropped_logs,
563+
max_queue_size = max_queue_size,
564+
message = "Logs were dropped due to a queue being full or other error. The count represents the total count of log records dropped in the lifetime of this BatchLogProcessor. Consider increasing the queue size and/or decrease delay between intervals."
565+
);
566+
}
557567
let (res_sender, res_receiver) = oneshot::channel();
558568
self.message_sender
559569
.try_send(BatchMessageWithAsyncRuntime::Shutdown(res_sender))
@@ -669,7 +679,7 @@ impl<R: RuntimeChannel> BatchLogProcessorWithAsyncRuntime<R> {
669679
BatchLogProcessorWithAsyncRuntime {
670680
message_sender,
671681
dropped_logs_count: AtomicUsize::new(0),
672-
max_queue_size,
682+
max_queue_size: config.max_queue_size,
673683
}
674684
}
675685

0 commit comments

Comments
 (0)