Skip to content

Commit 87e4dd2

Browse files
authored
proxy: Demote all cplane error replies to info log level (#9880)
## Problem The vast majority of the error/warn logs from cplane are about time or data transfer quotas exceeded or endpoint-not-found errors and not operational errors in proxy or cplane. ## Summary of changes * Demote cplane error replies to info level. * Raise other errors from warn back to error.
1 parent 7a2f0ed commit 87e4dd2

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

proxy/src/proxy/wake_compute.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
use tracing::{error, info, warn};
1+
use tracing::{error, info};
22

33
use super::connect_compute::ComputeConnectBackend;
44
use crate::config::RetryConfig;
55
use crate::context::RequestContext;
6-
use crate::control_plane::errors::WakeComputeError;
6+
use crate::control_plane::errors::{ControlPlaneError, WakeComputeError};
77
use crate::control_plane::CachedNodeInfo;
88
use crate::error::ReportableError;
99
use crate::metrics::{
1010
ConnectOutcome, ConnectionFailuresBreakdownGroup, Metrics, RetriesMetricGroup, RetryType,
1111
};
1212
use crate::proxy::retry::{retry_after, should_retry};
1313

14+
// Use macro to retain original callsite.
15+
macro_rules! log_wake_compute_error {
16+
(error = ?$error:expr, $num_retries:expr, retriable = $retriable:literal) => {
17+
match $error {
18+
WakeComputeError::ControlPlane(ControlPlaneError::Message(_)) => {
19+
info!(error = ?$error, num_retries = $num_retries, retriable = $retriable, "couldn't wake compute node")
20+
}
21+
_ => error!(error = ?$error, num_retries = $num_retries, retriable = $retriable, "couldn't wake compute node"),
22+
}
23+
};
24+
}
25+
1426
pub(crate) async fn wake_compute<B: ComputeConnectBackend>(
1527
num_retries: &mut u32,
1628
ctx: &RequestContext,
@@ -20,7 +32,7 @@ pub(crate) async fn wake_compute<B: ComputeConnectBackend>(
2032
loop {
2133
match api.wake_compute(ctx).await {
2234
Err(e) if !should_retry(&e, *num_retries, config) => {
23-
error!(error = ?e, num_retries, retriable = false, "couldn't wake compute node");
35+
log_wake_compute_error!(error = ?e, num_retries, retriable = false);
2436
report_error(&e, false);
2537
Metrics::get().proxy.retries_metric.observe(
2638
RetriesMetricGroup {
@@ -32,7 +44,7 @@ pub(crate) async fn wake_compute<B: ComputeConnectBackend>(
3244
return Err(e);
3345
}
3446
Err(e) => {
35-
warn!(error = ?e, num_retries, retriable = true, "couldn't wake compute node");
47+
log_wake_compute_error!(error = ?e, num_retries, retriable = true);
3648
report_error(&e, true);
3749
}
3850
Ok(n) => {

0 commit comments

Comments
 (0)