File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
opentelemetry-sdk/src/logs Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,6 @@ impl Debug for BatchLogProcessor {
151151
152152impl LogProcessor for BatchLogProcessor {
153153 fn emit ( & self , record : & mut SdkLogRecord , instrumentation : & InstrumentationScope ) {
154- let _guard = Context :: enter_telemetry_suppressed_scope ( ) ;
155-
156154 let result = self
157155 . logs_sender
158156 . try_send ( Box :: new ( ( record. clone ( ) , instrumentation. clone ( ) ) ) ) ;
@@ -209,6 +207,10 @@ impl LogProcessor for BatchLogProcessor {
209207 }
210208 }
211209 Err ( mpsc:: TrySendError :: Disconnected ( _) ) => {
210+ // The following `otel_warn!` may cause an infinite feedback loop of
211+ // 'telemetry-induced-telemetry', potentially causing a stack overflow
212+ let _guard = Context :: enter_telemetry_suppressed_scope ( ) ;
213+
212214 // Given background thread is the only receiver, and it's
213215 // disconnected, it indicates the thread is shutdown
214216 otel_warn ! (
You can’t perform that action at this time.
0 commit comments