From dcd68155f041ea74e8021c926aac64fa26435396 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 12 Apr 2024 20:19:40 +0300 Subject: feat(tvix/store/pathinfo/grpc): instrument functions Change-Id: Idb7d7144be1917fbaf83e9fd76c5b2ebb3df98d2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11400 Autosubmit: flokli Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/store/src/pathinfoservice/grpc.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tvix') diff --git a/tvix/store/src/pathinfoservice/grpc.rs b/tvix/store/src/pathinfoservice/grpc.rs index 7d740429cfba..02e0cb590b3e 100644 --- a/tvix/store/src/pathinfoservice/grpc.rs +++ b/tvix/store/src/pathinfoservice/grpc.rs @@ -1,8 +1,10 @@ use super::PathInfoService; use crate::proto::{self, ListPathInfoRequest, PathInfo}; use async_stream::try_stream; +use data_encoding::BASE64; use futures::stream::BoxStream; use tonic::{async_trait, transport::Channel, Code}; +use tracing::instrument; use tvix_castore::{proto as castorepb, Error}; /// Connects to a (remote) tvix-store PathInfoService over gRPC. @@ -25,6 +27,7 @@ impl GRPCPathInfoService { #[async_trait] impl PathInfoService for GRPCPathInfoService { + #[instrument(level = "trace", skip_all, fields(path_info.digest = BASE64.encode(&digest)))] async fn get(&self, digest: [u8; 20]) -> Result, Error> { let path_info = self .grpc_client @@ -51,6 +54,7 @@ impl PathInfoService for GRPCPathInfoService { } } + #[instrument(level = "trace", skip_all, fields(path_info.root_node = ?path_info.node))] async fn put(&self, path_info: PathInfo) -> Result { let path_info = self .grpc_client @@ -63,6 +67,7 @@ impl PathInfoService for GRPCPathInfoService { Ok(path_info) } + #[instrument(level = "trace", skip_all, fields(root_node = ?root_node))] async fn calculate_nar( &self, root_node: &castorepb::node::Node, @@ -86,6 +91,7 @@ impl PathInfoService for GRPCPathInfoService { Ok((path_info.nar_size, nar_sha256)) } + #[instrument(level = "trace", skip_all)] fn list(&self) -> BoxStream<'static, Result> { let mut grpc_client = self.grpc_client.clone(); -- cgit 1.4.1