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 <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-03-08 22:59:50 +02:00 committed by clbot
parent 8f804f5d9c
commit 05deb37f44

View file

@ -86,7 +86,7 @@ where
// https://github.com/tokio-rs/tokio/issues/2723#issuecomment-1534723933 // https://github.com/tokio-rs/tokio/issues/2723#issuecomment-1534723933
type ReadStream = BoxStream<'static, Result<super::BlobChunk, Status>>; type ReadStream = BoxStream<'static, Result<super::BlobChunk, Status>>;
#[instrument(skip(self))] #[instrument(skip_all)]
async fn stat( async fn stat(
&self, &self,
request: Request<super::StatBlobRequest>, request: Request<super::StatBlobRequest>,
@ -103,11 +103,14 @@ where
chunks: chunk_metas, chunks: chunk_metas,
..Default::default() ..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( async fn read(
&self, &self,
request: Request<super::ReadBlobRequest>, request: Request<super::ReadBlobRequest>,
@ -126,11 +129,14 @@ where
Ok(Response::new(Box::pin(chunks_stream))) Ok(Response::new(Box::pin(chunks_stream)))
} }
Ok(None) => Err(Status::not_found(format!("blob {} not found", &req_digest))), 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( async fn put(
&self, &self,
request: Request<Streaming<super::BlobChunk>>, request: Request<Streaming<super::BlobChunk>>,