using ScadaLink.AuditLog.Payload; using ScadaLink.HealthMonitoring; namespace ScadaLink.AuditLog.Site; /// /// Audit Log (#23) M5 Bundle C โ€” bridges /// (incremented by /// every time a header / body / SQL /// parameter redactor stage throws and the filter has to over-redact the /// offending field) into so the count /// surfaces in the site health report payload as /// SiteHealthReport.AuditRedactionFailure. /// /// /// /// Registered by ; /// callers must register AddHealthMonitoring() first so /// resolves. The default /// registration keeps for nodes /// where Site Health Monitoring is not wired (the silent-sink contract โ€” /// redaction failures must NEVER abort the user-facing action, alog.md ยง7). /// /// /// Mirrors the M2 Bundle G /// shape one-for-one so the two health-metric bridges age together. /// /// /// Site-side only for M5: the redaction filter also runs on the central /// writers (CentralAuditWriter + AuditLogIngestActor), but the central /// health-metric surface that would expose AuditRedactionFailure /// alongside the existing central counters ships in M6. Until then, the /// central composition root keeps the NoOp default โ€” the redactions still /// happen, they just don't get counted into a health report. /// /// public sealed class HealthMetricsAuditRedactionFailureCounter : IAuditRedactionFailureCounter { private readonly ISiteHealthCollector _collector; public HealthMetricsAuditRedactionFailureCounter(ISiteHealthCollector collector) { _collector = collector ?? throw new ArgumentNullException(nameof(collector)); } /// public void Increment() => _collector.IncrementAuditRedactionFailure(); }