From 05bdb6852384f622071aefa070dd602ddb67ee45 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 11 Mar 2024 18:20:56 +0200 Subject: feat(tvix/blobservice/object_store) more logging Have derive_{blob,chunk}_path emit trace-level events for both the values they're called with, as well as the return value. With RUST_LOG in place, it doesn't get lost in other unrelated noise. Change-Id: Id2451e3657324eff482841eb26a22d19e22bde30 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11136 Autosubmit: flokli Reviewed-by: Connor Brewster Tested-by: BuildkiteCI --- tvix/castore/src/blobservice/object_store.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tvix') diff --git a/tvix/castore/src/blobservice/object_store.rs b/tvix/castore/src/blobservice/object_store.rs index 3adcd7850e65..0dba19ef54bb 100644 --- a/tvix/castore/src/blobservice/object_store.rs +++ b/tvix/castore/src/blobservice/object_store.rs @@ -14,7 +14,7 @@ use prost::Message; use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt}; use tokio_stream::StreamExt; use tonic::async_trait; -use tracing::{debug, info, instrument, trace}; +use tracing::{debug, info, instrument, trace, Level}; use url::Url; use crate::{ @@ -97,6 +97,7 @@ impl ObjectStoreBlobService { } } +#[instrument(level=Level::TRACE, skip_all,fields(base_path=%base_path,blob.digest=%digest),ret(Display))] fn derive_blob_path(base_path: &Path, digest: &B3Digest) -> Path { base_path .child("blobs") @@ -105,6 +106,7 @@ fn derive_blob_path(base_path: &Path, digest: &B3Digest) -> Path { .child(HEXLOWER.encode(digest.as_slice())) } +#[instrument(level=Level::TRACE, skip_all,fields(base_path=%base_path,chunk.digest=%digest),ret(Display))] fn derive_chunk_path(base_path: &Path, digest: &B3Digest) -> Path { base_path .child("chunks") -- cgit 1.4.1