Skip to content

Commit affe703

Browse files
chore(internal logs): Disable rate limiting for critical internal error logs (#24192)
* Improve debug log in aws_ecs_metrics * Add internal_log_rate_limit = false to config reload errors * Disable rate limiting for lua build failure * Disable rate limiting for amqp build failure * Add internal_log_rate_limit = false to important failures during reload * Disable log rate limit for repeated events in process.rs * Update src/config/watcher.rs * Fix message format
1 parent a488105 commit affe703

File tree

6 files changed

+42
-14
lines changed

6 files changed

+42
-14
lines changed

src/config/watcher.rs

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,38 @@ pub fn spawn_thread<'a>(
147147
.all(|(_, t)| *t == ComponentType::EnrichmentTable)
148148
{
149149
info!("Only enrichment tables have changed.");
150-
_ = signal_tx.send(crate::signal::SignalTo::ReloadEnrichmentTables).map_err(|error| {
151-
error!(message = "Unable to reload enrichment tables.", cause = %error)
152-
});
150+
_ = signal_tx
151+
.send(crate::signal::SignalTo::ReloadEnrichmentTables)
152+
.map_err(|error| {
153+
error!(
154+
message = "Unable to reload enrichment tables.",
155+
cause = %error,
156+
internal_log_rate_limit = false,
157+
)
158+
});
153159
} else {
154-
_ = signal_tx.send(crate::signal::SignalTo::ReloadComponents(changed_components.into_keys().collect())).map_err(|error| {
155-
error!(message = "Unable to reload component configuration. Restart Vector to reload it.", cause = %error)
156-
});
160+
_ = signal_tx
161+
.send(crate::signal::SignalTo::ReloadComponents(
162+
changed_components.into_keys().collect(),
163+
))
164+
.map_err(|error| {
165+
error!(
166+
message = "Unable to reload component configuration. Restart Vector to reload it.",
167+
cause = %error,
168+
internal_log_rate_limit = false,
169+
)
170+
});
157171
}
158172
} else {
159-
_ = signal_tx.send(crate::signal::SignalTo::ReloadFromDisk)
160-
.map_err(|error| {
161-
error!(message = "Unable to reload configuration file. Restart Vector to reload it.", cause = %error)
162-
});
173+
_ = signal_tx
174+
.send(crate::signal::SignalTo::ReloadFromDisk)
175+
.map_err(|error| {
176+
error!(
177+
message = "Unable to reload configuration file. Restart Vector to reload it.",
178+
cause = %error,
179+
internal_log_rate_limit = false,
180+
)
181+
});
163182
}
164183
} else {
165184
debug!(message = "Ignoring event.", event = ?event)

src/internal_events/aws_ecs_metrics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ impl InternalEvent for AwsEcsMetricsParseError<'_> {
5252
error_type = error_type::PARSER_FAILED,
5353
);
5454
debug!(
55-
message = %format!("Failed to parse response:\\n\\n{}\\n\\n", self.body.escape_debug()),
55+
response = %self.body.escape_debug(),
5656
endpoint = %self.endpoint,
57+
"Failed to parse response.",
5758
);
5859
counter!("parse_errors_total").increment(1);
5960
counter!(

src/internal_events/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ impl InternalEvent for ConfigReloadRejected {
1414
message = "Config reload rejected due to non-reloadable global options.",
1515
reason = %self.reason.as_str(),
1616
changed_fields = %fields.join(", "),
17+
internal_log_rate_limit = false,
1718
);
1819

1920
counter!(
@@ -27,6 +28,7 @@ impl InternalEvent for ConfigReloadRejected {
2728
message = "Config reload rejected due to failed to compute global diff.",
2829
reason = %self.reason.as_str(),
2930
error = %err,
31+
internal_log_rate_limit = false,
3032
);
3133

3234
counter!(

src/internal_events/lua.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl InternalEvent for LuaBuildError {
5858
error_type = error_type::SCRIPT_FAILED,
5959
error_code = lua_build_error_code(&self.error),
6060
stage = error_stage::PROCESSING,
61+
internal_log_rate_limit = false,
6162
);
6263
counter!(
6364
"component_errors_total",

src/internal_events/process.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ impl InternalEvent for VectorReloaded<'_> {
3030
info!(
3131
target: "vector",
3232
message = "Vector has reloaded.",
33-
path = ?self.config_paths
33+
path = ?self.config_paths,
34+
internal_log_rate_limit = false,
3435
);
3536
counter!("reloaded_total").increment(1);
3637
}
@@ -43,7 +44,7 @@ impl InternalEvent for VectorStopped {
4344
fn emit(self) {
4445
info!(
4546
target: "vector",
46-
message = "Vector has stopped."
47+
message = "Vector has stopped.",
4748
);
4849
counter!("stopped_total").increment(1);
4950
}
@@ -56,7 +57,7 @@ impl InternalEvent for VectorQuit {
5657
fn emit(self) {
5758
info!(
5859
target: "vector",
59-
message = "Vector has quit."
60+
message = "Vector has quit.",
6061
);
6162
counter!("quit_total").increment(1);
6263
}
@@ -72,6 +73,7 @@ impl InternalEvent for VectorReloadError {
7273
error_code = "reload",
7374
error_type = error_type::CONFIGURATION_FAILED,
7475
stage = error_stage::PROCESSING,
76+
internal_log_rate_limit = false,
7577
);
7678
counter!(
7779
"component_errors_total",
@@ -93,6 +95,7 @@ impl InternalEvent for VectorConfigLoadError {
9395
error_code = "config_load",
9496
error_type = error_type::CONFIGURATION_FAILED,
9597
stage = error_stage::PROCESSING,
98+
internal_log_rate_limit = false,
9699
);
97100
counter!(
98101
"component_errors_total",
@@ -114,6 +117,7 @@ impl InternalEvent for VectorRecoveryError {
114117
error_code = "recovery",
115118
error_type = error_type::CONFIGURATION_FAILED,
116119
stage = error_stage::PROCESSING,
120+
internal_log_rate_limit = false,
117121
);
118122
counter!(
119123
"component_errors_total",

src/sinks/amqp/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl AmqpPropertiesConfig {
4545
error = %error,
4646
error_type = error_type::TEMPLATE_FAILED,
4747
stage = error_stage::PROCESSING,
48+
internal_log_rate_limit = false,
4849
);
4950
Default::default()
5051
});

0 commit comments

Comments
 (0)