From b1b98b54cae5fe5b40f3764f40e63dee4a1d5a43 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Fri, 8 Nov 2024 10:14:20 +0000 Subject: [PATCH] chore: add more traces --- src/mito2/src/cache.rs | 2 ++ src/mito2/src/cache/file_cache.rs | 3 ++- src/mito2/src/read/scan_region.rs | 1 + src/mito2/src/sst/parquet/metadata.rs | 2 ++ src/mito2/src/sst/parquet/reader.rs | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mito2/src/cache.rs b/src/mito2/src/cache.rs index 7d977a328ca1..4cbb0c3f6a89 100644 --- a/src/mito2/src/cache.rs +++ b/src/mito2/src/cache.rs @@ -26,6 +26,7 @@ use std::mem; use std::sync::Arc; use bytes::Bytes; +use common_telemetry::tracing; use datatypes::value::Value; use datatypes::vectors::VectorRef; use moka::notification::RemovalCause; @@ -82,6 +83,7 @@ impl CacheManager { /// Gets cached [ParquetMetaData] from in-memory cache first. /// If not found, tries to get it from write cache and fill the in-memory cache. + #[tracing::instrument(level = tracing::Level::DEBUG, skip_all)] pub async fn get_parquet_meta_data( &self, region_id: RegionId, diff --git a/src/mito2/src/cache/file_cache.rs b/src/mito2/src/cache/file_cache.rs index 9aebcc48e988..660ab729c190 100644 --- a/src/mito2/src/cache/file_cache.rs +++ b/src/mito2/src/cache/file_cache.rs @@ -20,7 +20,7 @@ use std::time::{Duration, Instant}; use bytes::Bytes; use common_base::readable_size::ReadableSize; -use common_telemetry::{info, warn}; +use common_telemetry::{info, tracing, warn}; use futures::{FutureExt, TryStreamExt}; use moka::future::Cache; use moka::notification::RemovalCause; @@ -241,6 +241,7 @@ impl FileCache { /// Get the parquet metadata in file cache. /// If the file is not in the cache or fail to load metadata, return None. + #[tracing::instrument(level = tracing::Level::DEBUG, skip_all)] pub(crate) async fn get_parquet_meta_data(&self, key: IndexKey) -> Option { // Check if file cache contains the key if let Some(index_value) = self.memory_index.get(&key).await { diff --git a/src/mito2/src/read/scan_region.rs b/src/mito2/src/read/scan_region.rs index 823db8279ab2..b634f7667ed3 100644 --- a/src/mito2/src/read/scan_region.rs +++ b/src/mito2/src/read/scan_region.rs @@ -948,6 +948,7 @@ struct FileRangeBuilder { impl FileRangeBuilder { /// Builds file ranges to read. /// Negative `row_group_index` indicates all row groups. + #[tracing::instrument(level = tracing::Level::DEBUG, skip_all)] fn build_ranges(&self, row_group_index: i64, ranges: &mut SmallVec<[FileRange; 2]>) { let Some(context) = self.context.clone() else { return; diff --git a/src/mito2/src/sst/parquet/metadata.rs b/src/mito2/src/sst/parquet/metadata.rs index e39f25972302..386fa8b74f13 100644 --- a/src/mito2/src/sst/parquet/metadata.rs +++ b/src/mito2/src/sst/parquet/metadata.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use common_telemetry::tracing; use object_store::ObjectStore; use parquet::file::footer::{decode_footer, decode_metadata}; use parquet::file::metadata::ParquetMetaData; @@ -70,6 +71,7 @@ impl<'a> MetadataLoader<'a> { /// ``` /// /// Refer to https://github.com/apache/arrow-rs/blob/093a10e46203be1a0e94ae117854701bf58d4c79/parquet/src/arrow/async_reader/metadata.rs#L55-L106 + #[tracing::instrument(level = tracing::Level::DEBUG, skip_all)] pub async fn load(&self) -> Result { let object_store = &self.object_store; let path = self.file_path; diff --git a/src/mito2/src/sst/parquet/reader.rs b/src/mito2/src/sst/parquet/reader.rs index ed19ff8c93a0..751827333a5c 100644 --- a/src/mito2/src/sst/parquet/reader.rs +++ b/src/mito2/src/sst/parquet/reader.rs @@ -302,6 +302,7 @@ impl ParquetReaderBuilder { } /// Reads parquet metadata of specific file. + #[tracing::instrument(level = tracing::Level::DEBUG, skip_all)] async fn read_parquet_metadata( &self, file_path: &str,