about summary refs log tree commit diff
path: root/tvix/castore/src/directoryservice/utils.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-20T15·31+0200
committerflokli <flokli@flokli.de>2024-03-20T21·02+0000
commit345a639e799bed7a11ab75e3e90b4246e64269df (patch)
treeeb2fd33d40ebae07d79bfea80a05f47e1ac07ba8 /tvix/castore/src/directoryservice/utils.rs
parent60b47b336b2c1bc2d39dbe5b6360cab1cea9a5eb (diff)
refactor(tvix/castore): instrument DirectoryPutter impls consistently r/7756
Log the entire span with "trace" level, not just its `ret` level.

The level of the error value event defaults to ERROR, so we don't loose
these.

B3Digest implements Debug and Display the same way, so we can omit the
`(Display)` part in `ret(Display)` for them.

Change-Id: Id00d123a5798e5bdc9820dd97ae2b4d4eb5455f0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11218
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Diffstat (limited to 'tvix/castore/src/directoryservice/utils.rs')
-rw-r--r--tvix/castore/src/directoryservice/utils.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/tvix/castore/src/directoryservice/utils.rs b/tvix/castore/src/directoryservice/utils.rs
index 52d227d60b..6fa1a9e5fd 100644
--- a/tvix/castore/src/directoryservice/utils.rs
+++ b/tvix/castore/src/directoryservice/utils.rs
@@ -9,7 +9,6 @@ use std::collections::{HashSet, VecDeque};
 use tonic::async_trait;
 use tracing::instrument;
 use tracing::warn;
-use tracing::Level;
 
 /// Traverses a [proto::Directory] from the root to the children.
 ///
@@ -105,7 +104,7 @@ impl<DS: DirectoryService> SimplePutter<DS> {
 
 #[async_trait]
 impl<DS: DirectoryService + 'static> DirectoryPutter for SimplePutter<DS> {
-    #[instrument(skip_all, fields(directory.digest=%directory.digest()), err)]
+    #[instrument(level = "trace", skip_all, fields(directory.digest=%directory.digest()), err)]
     async fn put(&mut self, directory: proto::Directory) -> Result<(), Error> {
         if self.closed {
             return Err(Error::StorageError("already closed".to_string()));
@@ -119,7 +118,7 @@ impl<DS: DirectoryService + 'static> DirectoryPutter for SimplePutter<DS> {
         Ok(())
     }
 
-    #[instrument(skip_all, ret(Display, level=Level::TRACE), err)]
+    #[instrument(level = "trace", skip_all, ret, err)]
     async fn close(&mut self) -> Result<B3Digest, Error> {
         if self.closed {
             return Err(Error::StorageError("already closed".to_string()));