From 05deb37f442c559eed160c03beafdee04d7cbf66 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 8 Mar 2024 22:59:50 +0200 Subject: fix(tvix/castore/grpc/blob): skip_all fields in instrument This only contains the outer metadata wrapping, and that's not too interesting: > Request { metadata: MetadataMap { headers: {"content-type": > "application/grpc", "user-agent": "grpc-go/1.60.1", "te": "trailers", > "grpc-accept-encoding": "gzip"} }, message: Streaming, extensions: > Extensions } Drop these fields for now, and rely on the underlying implementations to add instrumentation for the application-specific fields. Log errors in some places where we didn't so far. Change-Id: Ia68d6c526987d3716be62a0809195401cf28512b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11101 Autosubmit: flokli Reviewed-by: Connor Brewster Tested-by: BuildkiteCI --- tvix/castore/src/proto/grpc_blobservice_wrapper.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tvix/castore/src/proto/grpc_blobservice_wrapper.rs b/tvix/castore/src/proto/grpc_blobservice_wrapper.rs index 9f3f944da26f..a7f84dbe6077 100644 --- a/tvix/castore/src/proto/grpc_blobservice_wrapper.rs +++ b/tvix/castore/src/proto/grpc_blobservice_wrapper.rs @@ -86,7 +86,7 @@ where // https://github.com/tokio-rs/tokio/issues/2723#issuecomment-1534723933 type ReadStream = BoxStream<'static, Result>; - #[instrument(skip(self))] + #[instrument(skip_all)] async fn stat( &self, request: Request, @@ -103,11 +103,14 @@ where chunks: chunk_metas, ..Default::default() })), - Err(e) => Err(e.into()), + Err(e) => { + warn!(err=%e, "failed to request chunks"); + Err(e.into()) + } } } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn read( &self, request: Request, @@ -126,11 +129,14 @@ where Ok(Response::new(Box::pin(chunks_stream))) } Ok(None) => Err(Status::not_found(format!("blob {} not found", &req_digest))), - Err(e) => Err(e.into()), + Err(e) => { + warn!(err=%e, "failed to call open_read"); + Err(e.into()) + } } } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn put( &self, request: Request>, -- cgit 1.4.1