use crate::observability::MetricsRegistry;

/// Records a resilience decision and emits a low-cardinality tracing event.
pub fn record_resilience_decision(
    metrics: Option<&MetricsRegistry>,
    transport: &str,
    component: &str,
    outcome: &str,
) {
    if let Some(metrics) = metrics {
        metrics.record_resilience_event_for_transport(transport, component, outcome);
    }
    let span = tracing::debug_span!(
        "rs_zero.resilience.decision",
        transport = transport,
        component = component,
        outcome = outcome
    );
    let _entered = span.enter();
    tracing::debug!("resilience decision recorded");
}
