diff --git a/snix/castore/src/blobservice/grpc.rs b/snix/castore/src/blobservice/grpc.rs index 5c3474309..92403c38a 100644 --- a/snix/castore/src/blobservice/grpc.rs +++ b/snix/castore/src/blobservice/grpc.rs @@ -217,7 +217,9 @@ impl ServiceBuilder for GRPCBlobServiceConfig { ) -> Result, Box> { let client = proto::blob_service_client::BlobServiceClient::with_interceptor( crate::tonic::channel_from_url(&self.url.parse()?).await?, - snix_tracing::propagate::tonic::send_trace, + // tonic::service::Interceptor wants an unboxed Status as return type. + // https://github.com/hyperium/tonic/issues/2253 + |rq| snix_tracing::propagate::tonic::send_trace(rq).map_err(|e| *e), ); Ok(Arc::new(GRPCBlobService::from_client( instance_name.to_string(), diff --git a/snix/castore/src/directoryservice/grpc.rs b/snix/castore/src/directoryservice/grpc.rs index d85e08483..6a72e99e9 100644 --- a/snix/castore/src/directoryservice/grpc.rs +++ b/snix/castore/src/directoryservice/grpc.rs @@ -245,7 +245,9 @@ impl ServiceBuilder for GRPCDirectoryServiceConfig { ) -> Result, Box> { let client = proto::directory_service_client::DirectoryServiceClient::with_interceptor( crate::tonic::channel_from_url(&self.url.parse()?).await?, - snix_tracing::propagate::tonic::send_trace, + // tonic::service::Interceptor wants an unboxed Status as return type. + // https://github.com/hyperium/tonic/issues/2253 + |rq| snix_tracing::propagate::tonic::send_trace(rq).map_err(|e| *e), ); Ok(Arc::new(GRPCDirectoryService::from_client( instance_name.to_string(), diff --git a/snix/store/src/pathinfoservice/grpc.rs b/snix/store/src/pathinfoservice/grpc.rs index 79e99d927..a648abbbc 100644 --- a/snix/store/src/pathinfoservice/grpc.rs +++ b/snix/store/src/pathinfoservice/grpc.rs @@ -175,7 +175,9 @@ impl ServiceBuilder for GRPCPathInfoServiceConfig { ) -> Result, Box> { let client = proto::path_info_service_client::PathInfoServiceClient::with_interceptor( snix_castore::tonic::channel_from_url(&self.url.parse()?).await?, - snix_tracing::propagate::tonic::send_trace, + // tonic::service::Interceptor wants an unboxed Status as return type. + // https://github.com/hyperium/tonic/issues/2253 + |rq| snix_tracing::propagate::tonic::send_trace(rq).map_err(|e| *e), ); Ok(Arc::new(GRPCPathInfoService::from_client( instance_name.to_string(), diff --git a/snix/tracing/src/propagate/tonic.rs b/snix/tracing/src/propagate/tonic.rs index 75455c056..e7f3cc030 100644 --- a/snix/tracing/src/propagate/tonic.rs +++ b/snix/tracing/src/propagate/tonic.rs @@ -45,7 +45,9 @@ impl Injector for MetadataInjector<'_> { /// Trace context propagation: send the trace context by injecting it into the metadata of the given /// request. This only injects the current span if the otlp feature is also enabled. #[allow(unused_mut)] -pub fn send_trace(mut request: tonic::Request) -> Result, tonic::Status> { +pub fn send_trace( + mut request: tonic::Request, +) -> Result, Box> { #[cfg(feature = "otlp")] { global::get_text_map_propagator(|propagator| {