diff --git a/Cargo.lock b/Cargo.lock index 0e93f76436..d4cb5f736b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1349,6 +1349,7 @@ dependencies = [ "common-grpc-expr", "common-query", "common-recordbatch", + "common-telemetry", "common-time", "datafusion", "datanode", diff --git a/src/client/Cargo.toml b/src/client/Cargo.toml index 9f25e299ef..a02c8e9f6c 100644 --- a/src/client/Cargo.toml +++ b/src/client/Cargo.toml @@ -16,6 +16,7 @@ common-grpc-expr = { path = "../common/grpc-expr" } common-query = { path = "../common/query" } common-recordbatch = { path = "../common/recordbatch" } common-time = { path = "../common/time" } +common-telemetry = { path = "../common/telemetry" } datafusion.workspace = true datatypes = { path = "../datatypes" } enum_dispatch = "0.3" diff --git a/src/client/src/database.rs b/src/client/src/database.rs index 8b88728ca6..f76365d3a4 100644 --- a/src/client/src/database.rs +++ b/src/client/src/database.rs @@ -26,6 +26,7 @@ use arrow_flight::{FlightData, Ticket}; use common_error::prelude::*; use common_grpc::flight::{flight_messages_to_recordbatches, FlightDecoder, FlightMessage}; use common_query::Output; +use common_telemetry::logging; use futures_util::{TryFutureExt, TryStreamExt}; use prost::Message; use snafu::{ensure, ResultExt}; @@ -149,6 +150,15 @@ impl Database { tonic_code: e.code(), addr: client.addr(), }) + .map_err(|error| { + logging::error!( + "Failed to do Flight get, addr: {}, code: {}, source: {}", + client.addr(), + e.code(), + error + ); + error + }) .unwrap_err() })?; diff --git a/src/client/src/error.rs b/src/client/src/error.rs index 5e2a7979c7..aae7f0866a 100644 --- a/src/client/src/error.rs +++ b/src/client/src/error.rs @@ -26,12 +26,7 @@ pub enum Error { backtrace: Backtrace, }, - #[snafu(display( - "Failed to do Flight get, addr: {}, code: {}, source: {}", - addr, - tonic_code, - source - ))] + #[snafu(display("Failed to do Flight get, code: {}, source: {}", tonic_code, source))] FlightGet { addr: String, tonic_code: Code,