Skip to content

Commit ca9eae4

Browse files
committed
fix: ban tracing::enabled!
due to tokio-rs/tracing#2448
1 parent 23b36dc commit ca9eae4

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

clippy.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
disallowed-macros = [
2+
# https://github.com/tokio-rs/tracing/issues/2448
3+
"tracing::enabled"
4+
]

src/insert_formatted.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ impl InsertFormatted {
150150
db.system.name = cfg!(feature = "opentelemetry").then_some("clickhouse"),
151151
// Only log full query text at TRACE level
152152
// Important that this is taken before client-side parameters are populated
153-
db.query.text = tracing::enabled!(tracing::Level::TRACE).then_some(&sql),
153+
// FIXME: we can't use `enabled!` due to https://github.com/tokio-rs/tracing/issues/2448
154+
// but we don't want to log the full query at all verbosity levels.
155+
// db.query.text = tracing::enabled!(tracing::Level::TRACE).then_some(&sql),
154156
// TODO: generate summary
155157
db.query.summary = tracing::field::Empty,
156158
db.operation.name = "INSERT",

src/query.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ impl Query {
186186
db.system.name = cfg!(feature = "opentelemetry").then_some("clickhouse"),
187187
// Only log full query text at TRACE level
188188
// Important that this is taken before client-side parameters are populated
189-
db.query.text = tracing::enabled!(tracing::Level::TRACE).then(|| self.sql.to_string()),
189+
// FIXME: we can't use `enabled!` due to https://github.com/tokio-rs/tracing/issues/2448
190+
// but we don't want to log the full query at all verbosity levels.
191+
// db.query.text = tracing::enabled!(tracing::Level::TRACE).then(|| self.sql.to_string()),
190192
// TODO: generate summary
191193
db.query.summary = tracing::field::Empty,
192194
db.response.status_code = tracing::field::Empty,

0 commit comments

Comments
 (0)