@@ -15,19 +15,21 @@ fn main() {
1515 . with_simple_exporter ( exporter)
1616 . build ( ) ;
1717
18- // For the OpenTelemetry layer, add a tracing filter to filter events from
19- // OpenTelemetry and its dependent crates (opentelemetry-otlp uses crates
20- // like reqwest/tonic etc.) from being sent back to OTel itself, thus
21- // preventing infinite telemetry generation. The filter levels are set as
22- // follows:
18+ // To prevent a telemetry-induced-telemetry loop, OpenTelemetry's own internal
19+ // logging is properly suppressed. However, logs emitted by external components
20+ // (such as reqwest, tonic, etc.) are not suppressed as they do not propagate
21+ // OpenTelemetry context. Until this issue is addressed
22+ // (https://github.com/open-telemetry/opentelemetry-rust/issues/2877),
23+ // filtering like this is the best way to suppress such logs.
24+ //
25+ // The filter levels are set as follows:
2326 // - Allow `info` level and above by default.
24- // - Restrict `opentelemetry `, `hyper `, `tonic `, and `reqwest` completely .
25- // Note: This will also drop events from crates like `tonic` etc. even when
26- // they are used outside the OTLP Exporter. For more details, see:
27- // https://github.com/open-telemetry/opentelemetry-rust/issues/761
27+ // - Completely restrict logs from `hyper `, `tonic `, `h2 `, and `reqwest`.
28+ //
29+ // Note: This filtering will also drop logs from these components even when
30+ // they are used outside of the OTLP Exporter.
2831 let filter_otel = EnvFilter :: new ( "info" )
2932 . add_directive ( "hyper=off" . parse ( ) . unwrap ( ) )
30- . add_directive ( "opentelemetry=off" . parse ( ) . unwrap ( ) )
3133 . add_directive ( "tonic=off" . parse ( ) . unwrap ( ) )
3234 . add_directive ( "h2=off" . parse ( ) . unwrap ( ) )
3335 . add_directive ( "reqwest=off" . parse ( ) . unwrap ( ) ) ;
0 commit comments