Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editoast: reduce logging level to trace for some verbose events #9950

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Instrumentation for TracingInstrumentation {
match event {
InstrumentationEvent::StartEstablishConnection { url, .. } => {
let url = Url::parse(url).unwrap();
let span = tracing::info_span!(
let span = tracing::trace_span!(
"connection",
// opentelemetry_semantic_conventions::attribute::DB_SYSTEM
"db.system" = "postgresql",
Expand All @@ -40,7 +40,7 @@ impl Instrumentation for TracingInstrumentation {
);
{
let _guard = span.enter();
tracing::debug!("establishing a connection");
tracing::trace!("establishing a connection");
}
self.connection_span = span;
}
Expand All @@ -54,7 +54,7 @@ impl Instrumentation for TracingInstrumentation {
);
tracing::warn!("failed to establish a connection");
} else {
tracing::debug!("connection established");
tracing::trace!("connection established");
}
}
self.connection_span = tracing::Span::none();
Expand All @@ -69,15 +69,15 @@ impl Instrumentation for TracingInstrumentation {
);
{
let _guard = span.enter();
tracing::debug!("starting query");
tracing::trace!("starting query");
}
if let Some(_existing_span) = self.query_spans.take() {
tracing::warn!("a query was already started: are you pipelining queries on the same connection?");
}
self.query_spans = Some(span);
}
InstrumentationEvent::CacheQuery { .. } => {
tracing::debug!("caching query");
tracing::trace!("caching query");
}
InstrumentationEvent::FinishQuery { query, error, .. } => {
let span = self
Expand All @@ -96,7 +96,7 @@ impl Instrumentation for TracingInstrumentation {
);
tracing::warn!("failed to execute the query");
} else {
tracing::debug!("query finished");
tracing::trace!("query finished");
}
}
InstrumentationEvent::BeginTransaction { depth, .. } => {
Expand All @@ -110,7 +110,7 @@ impl Instrumentation for TracingInstrumentation {
);
{
let _guard = span.enter();
tracing::debug!("beginning transaction");
tracing::trace!("beginning transaction");
}
self.transaction_spans.push_back(span);
}
Expand All @@ -125,7 +125,7 @@ impl Instrumentation for TracingInstrumentation {
opentelemetry_semantic_conventions::attribute::DB_OPERATION_NAME,
"commit_transaction",
);
tracing::debug!("committing transaction");
tracing::trace!("committing transaction");
}
InstrumentationEvent::RollbackTransaction { depth, .. } => {
debug_assert_eq!(self.transaction_spans.len(), depth.get() as usize);
Expand All @@ -138,7 +138,7 @@ impl Instrumentation for TracingInstrumentation {
opentelemetry_semantic_conventions::attribute::DB_OPERATION_NAME,
"rollback_transaction",
);
tracing::debug!("rollbacking transaction");
tracing::trace!("rollbacking transaction");
}
_ => {
tracing::warn!("unknown instrumentation event, maybe 'InstrumentationEvent' evolved since last time this code was updated?");
Expand Down
4 changes: 2 additions & 2 deletions editoast/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use serde::Deserialize;
use serde::Serialize;
use serde_json::Value;
use thiserror::Error;
use tracing::debug;
use tracing::error;
use tracing::trace;

#[cfg(test)]
use crate::core::mocking::MockingError;
Expand Down Expand Up @@ -95,7 +95,7 @@ impl CoreClient {
body: Option<&B>,
infra_id: Option<i64>,
) -> Result<R::Response> {
debug!(
trace!(
target: "editoast::coreclient",
body = body.and_then(|b| serde_json::to_string_pretty(b).ok()).unwrap_or_default(),
"Request content");
Expand Down
Loading