From cc874c16aea636614685307368df7d161e5f8812 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 3 Oct 2023 16:56:08 -0400 Subject: [PATCH 1/2] tree-wide: Clean up usage of `tracing::instrument` We're really verbose with `env RUST_LOG=debug`...most of these spans shouldn't be emitting any arguments at all . And even then let's lower to debug level for them too. --- lib/src/container/encapsulate.rs | 2 +- lib/src/container/unencapsulate.rs | 3 +-- lib/src/tar/import.rs | 4 ++-- lib/src/tar/write.rs | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/src/container/encapsulate.rs b/lib/src/container/encapsulate.rs index 0b1ca300..14f6ec9a 100644 --- a/lib/src/container/encapsulate.rs +++ b/lib/src/container/encapsulate.rs @@ -317,7 +317,7 @@ pub(crate) fn parse_oci_path_and_tag(path: &str) -> (&str, Option<&str>) { } /// Helper for `build()` that avoids generics -#[instrument(skip(repo, config, opts))] +#[instrument(level = "debug", skip_all)] async fn build_impl( repo: &ostree::Repo, ostree_ref: &str, diff --git a/lib/src/container/unencapsulate.rs b/lib/src/container/unencapsulate.rs index 1e162bfd..13c6f844 100644 --- a/lib/src/container/unencapsulate.rs +++ b/lib/src/container/unencapsulate.rs @@ -178,7 +178,7 @@ pub(crate) async fn join_fetch( /// Fetch a container image and import its embedded OSTree commit. #[context("Importing {}", imgref)] -#[instrument(skip(repo))] +#[instrument(level = "debug", skip(repo))] pub async fn unencapsulate(repo: &ostree::Repo, imgref: &OstreeImageReference) -> Result { let importer = super::store::ImageImporter::new(repo, imgref, Default::default()).await?; importer.unencapsulate().await @@ -199,7 +199,6 @@ fn new_async_decompressor<'a>( } /// A wrapper for [`get_blob`] which fetches a layer and decompresses it. -//#[instrument(skip(proxy, img, layer))] pub(crate) async fn fetch_layer_decompress<'a>( proxy: &'a mut ImageProxy, img: &OpenedImage, diff --git a/lib/src/tar/import.rs b/lib/src/tar/import.rs index 61bae219..3967cf8f 100644 --- a/lib/src/tar/import.rs +++ b/lib/src/tar/import.rs @@ -806,7 +806,7 @@ pub struct TarImportOptions { /// Read the contents of a tarball and import the ostree commit inside. /// Returns the sha256 of the imported commit. -#[instrument(skip(repo, src))] +#[instrument(level = "debug", skip_all)] pub async fn import_tar( repo: &ostree::Repo, src: impl tokio::io::AsyncRead + Send + Unpin + 'static, @@ -831,7 +831,7 @@ pub async fn import_tar( /// Read the contents of a tarball and import the content objects inside. /// Generates a synthetic commit object referencing them. -#[instrument(skip(repo, src))] +#[instrument(level = "debug", skip_all)] pub async fn import_tar_objects( repo: &ostree::Repo, src: impl tokio::io::AsyncRead + Send + Unpin + 'static, diff --git a/lib/src/tar/write.rs b/lib/src/tar/write.rs index 99da2a3d..4844134a 100644 --- a/lib/src/tar/write.rs +++ b/lib/src/tar/write.rs @@ -286,7 +286,7 @@ async fn filter_tar_async( /// Write the contents of a tarball as an ostree commit. #[allow(unsafe_code)] // For raw fd bits -#[instrument(skip(repo, src))] +#[instrument(level = "debug", skip_all)] pub async fn write_tar( repo: &ostree::Repo, src: impl tokio::io::AsyncRead + Send + Unpin + 'static, From 5e0469d2a2335a15594632366a999344ea467593 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 3 Oct 2023 16:59:36 -0400 Subject: [PATCH 2/2] store: Silence extremely verbose tracing::debug This ends up recursing into the manifest/config objects which is a wall of spam with `env RUST_LOG=debug`. Just print the merge commit to start here. --- lib/src/container/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/container/store.rs b/lib/src/container/store.rs index 901067b0..47c8ad69 100644 --- a/lib/src/container/store.rs +++ b/lib/src/container/store.rs @@ -1154,7 +1154,7 @@ pub fn query_image_commit(repo: &ostree::Repo, commit: &str) -> Result