mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 15:37:02 +00:00
refactor(logging): normalize admin telemetry and error messages (#3430)
This commit is contained in:
@@ -160,7 +160,7 @@ impl AuditMetrics {
|
||||
component = LOG_COMPONENT_AUDIT,
|
||||
subsystem = LOG_SUBSYSTEM_OBSERVABILITY,
|
||||
state = "config_reloaded",
|
||||
"Audit observability state updated"
|
||||
"audit observability state"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ impl AuditMetrics {
|
||||
component = LOG_COMPONENT_AUDIT,
|
||||
subsystem = LOG_SUBSYSTEM_OBSERVABILITY,
|
||||
state = "system_started",
|
||||
"Audit observability state updated"
|
||||
"audit observability state"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ impl AuditMetrics {
|
||||
component = LOG_COMPONENT_AUDIT,
|
||||
subsystem = LOG_SUBSYSTEM_OBSERVABILITY,
|
||||
state = "metrics_reset",
|
||||
"Audit observability state updated"
|
||||
"audit observability state"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ impl AuditRuntimeView {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target_id,
|
||||
state = "enabled",
|
||||
"Changed audit target state"
|
||||
"audit target state"
|
||||
);
|
||||
Ok(())
|
||||
} else {
|
||||
@@ -283,7 +283,7 @@ impl AuditRuntimeView {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target_id,
|
||||
state = "disabled",
|
||||
"Changed audit target state"
|
||||
"audit target state"
|
||||
);
|
||||
Ok(())
|
||||
} else {
|
||||
@@ -300,7 +300,7 @@ impl AuditRuntimeView {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target_id,
|
||||
state = "removed",
|
||||
"Changed audit target state"
|
||||
"audit target state"
|
||||
);
|
||||
Ok(())
|
||||
} else {
|
||||
@@ -323,7 +323,7 @@ impl AuditRuntimeView {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target_id,
|
||||
state = "upserted",
|
||||
"Changed audit target state"
|
||||
"audit target state"
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
@@ -349,7 +349,7 @@ impl AuditRuntimeFacade {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target.id(),
|
||||
replay_key = %key,
|
||||
"Delivered queued audit event"
|
||||
"audit replay delivery"
|
||||
);
|
||||
observability::record_target_success();
|
||||
}
|
||||
@@ -361,7 +361,7 @@ impl AuditRuntimeFacade {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target.id(),
|
||||
reason = "not_connected",
|
||||
"Retrying queued audit event delivery"
|
||||
"audit replay delivery"
|
||||
);
|
||||
}
|
||||
rustfs_targets::TargetError::Timeout(_) => {
|
||||
@@ -371,7 +371,7 @@ impl AuditRuntimeFacade {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target.id(),
|
||||
reason = "timeout",
|
||||
"Retrying queued audit event delivery"
|
||||
"audit replay delivery"
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
@@ -383,7 +383,7 @@ impl AuditRuntimeFacade {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target.id(),
|
||||
reason = %reason,
|
||||
"Dropped queued audit payload"
|
||||
"audit replay delivery"
|
||||
);
|
||||
observability::record_target_failure();
|
||||
}
|
||||
@@ -395,7 +395,7 @@ impl AuditRuntimeFacade {
|
||||
target_id = %target.id(),
|
||||
error = %error,
|
||||
reason = "permanent_failure",
|
||||
"Queued audit payload failed permanently"
|
||||
"audit replay delivery"
|
||||
);
|
||||
target.record_final_failure();
|
||||
observability::record_target_failure();
|
||||
@@ -408,7 +408,7 @@ impl AuditRuntimeFacade {
|
||||
target_id = %target.id(),
|
||||
replay_key = %key,
|
||||
reason = "retry_exhausted",
|
||||
"Dropped queued audit payload after retry exhaustion"
|
||||
"audit replay delivery"
|
||||
);
|
||||
target.record_final_failure();
|
||||
observability::record_target_failure();
|
||||
@@ -422,7 +422,7 @@ impl AuditRuntimeFacade {
|
||||
replay_key = %key,
|
||||
error = %error,
|
||||
reason = "unreadable_entry",
|
||||
"Skipped unreadable audit store entry"
|
||||
"audit replay delivery"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -436,7 +436,7 @@ impl AuditRuntimeFacade {
|
||||
subsystem = LOG_SUBSYSTEM_PIPELINE,
|
||||
target_id = %target_id,
|
||||
replay_enabled = true,
|
||||
"Audit replay stream started"
|
||||
"audit replay stream"
|
||||
);
|
||||
} else {
|
||||
debug!(
|
||||
@@ -446,7 +446,7 @@ impl AuditRuntimeFacade {
|
||||
target_id = %target_id,
|
||||
replay_enabled = false,
|
||||
reason = "no_store_configured",
|
||||
"Audit replay stream skipped"
|
||||
"audit replay stream"
|
||||
);
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -198,7 +198,7 @@ impl AuditRegistry {
|
||||
target_type = %target_type,
|
||||
target_id = %target_id,
|
||||
registry_key = %key,
|
||||
"Created audit target registry key"
|
||||
"audit target registry state"
|
||||
);
|
||||
key.to_string()
|
||||
}
|
||||
@@ -221,7 +221,7 @@ impl AuditRegistry {
|
||||
target_type = %target_type,
|
||||
target_id = %target_id,
|
||||
state = "enabled",
|
||||
"Audit target registry state changed"
|
||||
"audit target registry state"
|
||||
);
|
||||
Ok(())
|
||||
} else {
|
||||
@@ -250,7 +250,7 @@ impl AuditRegistry {
|
||||
target_type = %target_type,
|
||||
target_id = %target_id,
|
||||
state = "disabled",
|
||||
"Audit target registry state changed"
|
||||
"audit target registry state"
|
||||
);
|
||||
Ok(())
|
||||
} else {
|
||||
|
||||
@@ -120,7 +120,7 @@ impl AuditSystem {
|
||||
subsystem = LOG_SUBSYSTEM_SYSTEM,
|
||||
state = "targets_created",
|
||||
target_count = targets.len(),
|
||||
"Created audit targets"
|
||||
"audit system state"
|
||||
);
|
||||
|
||||
let activation = self.runtime_facade().activate_targets_with_replay(targets).await;
|
||||
@@ -159,7 +159,7 @@ impl AuditSystem {
|
||||
component = LOG_COMPONENT_AUDIT,
|
||||
subsystem = LOG_SUBSYSTEM_SYSTEM,
|
||||
state = "starting",
|
||||
"Starting audit system"
|
||||
"audit system state"
|
||||
);
|
||||
|
||||
// Record system start
|
||||
@@ -268,7 +268,7 @@ impl AuditSystem {
|
||||
component = LOG_COMPONENT_AUDIT,
|
||||
subsystem = LOG_SUBSYSTEM_SYSTEM,
|
||||
state = "stopping",
|
||||
"Stopping audit system"
|
||||
"audit system state"
|
||||
);
|
||||
|
||||
// Stop all stream tasks first
|
||||
@@ -441,7 +441,7 @@ impl AuditSystem {
|
||||
component = LOG_COMPONENT_AUDIT,
|
||||
subsystem = LOG_SUBSYSTEM_SYSTEM,
|
||||
state = "reloading",
|
||||
"Reloading audit configuration"
|
||||
"audit config reload"
|
||||
);
|
||||
|
||||
observability::record_config_reload();
|
||||
@@ -465,7 +465,7 @@ impl AuditSystem {
|
||||
component = LOG_COMPONENT_AUDIT,
|
||||
subsystem = LOG_SUBSYSTEM_SYSTEM,
|
||||
state = "reloaded",
|
||||
"Reloaded audit configuration"
|
||||
"audit config reload"
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
@@ -513,7 +513,7 @@ fn info_audit_state(state: &str, reason: Option<&str>, target_count: Option<usiz
|
||||
state,
|
||||
reason = reason.unwrap_or_default(),
|
||||
target_count = target_count.unwrap_or_default(),
|
||||
"Changed audit system state"
|
||||
"audit system state"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ fn debug_audit_state(state: &str, reason: Option<&str>, error: Option<&str>, tar
|
||||
reason = reason.unwrap_or_default(),
|
||||
error = error.unwrap_or_default(),
|
||||
target_count,
|
||||
"Observed audit system state"
|
||||
"audit system state"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ fn warn_audit_state(state: &str, reason: Option<&str>) {
|
||||
subsystem = LOG_SUBSYSTEM_SYSTEM,
|
||||
state,
|
||||
reason = reason.unwrap_or_default(),
|
||||
"Audit system state transition skipped"
|
||||
"audit system state"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user