pub fn report_varlink_failure(
no_fallback: bool,
collector: &str,
fallback: &str,
source: Error,
) -> Result<(), NoFallbackError>Expand description
Record a varlink failure and decide whether the caller may fall back.
Returns Ok(()) (after logging the falling back warning) by default,
so the caller proceeds to its fallback. Returns Err when no_fallback
is true, turning the failure into the collector’s error — which
stat_collector logs per-collector and counts in collector_timings
success, so a no-fallback CI run fails visibly rather than earning a
quiet varlink_usage.* = 0 gauge.
source is taken as anyhow::Error because every varlink call site
already produces one (sockets, protocol and version-gate failures all
funnel through anyhow).