Skip to content

Commit

Permalink
Improve tracing statements
Browse files Browse the repository at this point in the history
  • Loading branch information
alpeb committed Dec 13, 2023
1 parent c7d9a91 commit 2de904f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions reinitialize-pods/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,12 @@ async fn process_events(
match tx.try_send(pod.clone()) {
Ok(_) => {}
Err(TrySendError::Full(_)) => {
tracing::warn!(
name = format!("{namespace}/{name}"),
"Dropped event (channel full)"
);
tracing::warn!(%namespace, %name, "Dropped event (channel full)");
metrics.queue_overflow.inc();
}
Err(TrySendError::Closed(_)) => tracing::warn!(
name = format!("{namespace}/{name}"),
"Dropped event (channel closed or dropped)"
),
Err(TrySendError::Closed(_)) => {
tracing::warn!(%namespace, %name, "Dropped event (channel closed or dropped)")
}
}
}
}
Expand All @@ -116,16 +112,16 @@ async fn process_pods(
let evict_res = pods.evict(&name, &Default::default()).await;
match evict_res {
Ok(_) => {
tracing::info!(name = format!("{namespace}/{name}"), "Evicting pod");
tracing::info!(%namespace, %name, "Evicting pod");
metrics.evicted_pods.inc();
if let Err(err) =
publish_k8s_event(client.clone(), controller_pod_name.clone(), &pod).await
{
tracing::warn!(%err, name = format!("{namespace}/{name}"), "Error publishing event");
tracing::warn!(%err, %namespace, %name, "Error publishing event");
}
}
Err(err) => {
tracing::warn!(%err, name = format!("{namespace}/{name}"), "Error evicting pod")
tracing::warn!(%err, %namespace, %name, "Error evicting pod")
}
}
}
Expand Down

0 comments on commit 2de904f

Please sign in to comment.