about summary refs log tree commit diff
path: root/tvix/castore/src/proto/grpc_blobservice_wrapper.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-08T20·59+0200
committerclbot <clbot@tvl.fyi>2024-03-09T05·47+0000
commit05deb37f442c559eed160c03beafdee04d7cbf66 (patch)
treef95fee0e3ac3fb7a9ad10d6575b752eabbad6405 /tvix/castore/src/proto/grpc_blobservice_wrapper.rs
parent8f804f5d9cdba1cfc96aede1cddde1f9b15e2c43 (diff)
fix(tvix/castore/grpc/blob): skip_all fields in instrument r/7659
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 <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/castore/src/proto/grpc_blobservice_wrapper.rs')
-rw-r--r--tvix/castore/src/proto/grpc_blobservice_wrapper.rs16
1 files 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 9f3f944da2..a7f84dbe60 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<super::BlobChunk, Status>>;
 
-    #[instrument(skip(self))]
+    #[instrument(skip_all)]
     async fn stat(
         &self,
         request: Request<super::StatBlobRequest>,
@@ -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<super::ReadBlobRequest>,
@@ -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<Streaming<super::BlobChunk>>,