diff --git a/core/lib/vlog/src/opentelemetry/mod.rs b/core/lib/vlog/src/opentelemetry/mod.rs index e8e07399881d..7d9297668660 100644 --- a/core/lib/vlog/src/opentelemetry/mod.rs +++ b/core/lib/vlog/src/opentelemetry/mod.rs @@ -164,10 +164,7 @@ impl OpenTelemetry { where S: tracing::Subscriber + for<'span> LookupSpan<'span> + Send + Sync, { - let Some(logging_endpoint) = self.logging_endpoint.clone() else { - return None; - }; - + let logging_endpoint = self.logging_endpoint.clone()?; let resource = self.service.clone().into_otlp_resource(); let exporter = opentelemetry_otlp::new_exporter() @@ -195,9 +192,7 @@ impl OpenTelemetry { where S: tracing::Subscriber + for<'span> LookupSpan<'span> + Send + Sync, { - let Some(tracing_endpoint) = self.tracing_endpoint.clone() else { - return None; - }; + let tracing_endpoint = self.tracing_endpoint.clone()?; // `otel::tracing` should be a level info to emit opentelemetry trace & span // `otel` set to debug to log detected resources, configuration read and inferred let filter = self