feat(audit,install): #1030 audit overflow drops exported as otopcua.audit.dropped; scripted SCM-restart-after-cluster-exit gate

- AuditWriterActor: every buffer-full drop is added to OtOpcUaTelemetry.AuditDropped
  (otopcua.audit.dropped{reason=buffer_full, actor}) — the count used to be readable only
  through the actor's own property.
- scripts/install/tests/Test-ScmRestartAfterClusterExit.Windows.ps1: the windev manual gate
  of 2026-12-03 as a script (qfailure restart action; failover/command trigger => non-zero exit,
  7031, Running under a new pid; Stop-Service stays stopped; optional kill control). Parse-checked
  with pwsh on macOS; must be run elevated on a Windows box hosting OtOpcUaHost.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-12-03 15:02:09 -05:00
parent 6b19f4add6
commit 2a8bac5bf5
7 changed files with 266 additions and 2 deletions
@@ -107,6 +107,20 @@ public static class OtOpcUaTelemetry
Meter.CreateCounter<long>("otopcua.scriptedalarm.transition", unit: "{transition}",
description: "Scripted-alarm state transitions (state=active|acknowledged|inactive).");
// ---------------- Audit ----------------
/// <summary>Instrument name of <see cref="AuditDropped"/>.</summary>
public const string AuditDroppedName = "otopcua.audit.dropped";
/// <summary>
/// lmxopcua#1030 — audit events the central <c>AuditWriterActor</c> dropped (oldest first) because its retry buffer
/// hit its bound while the ConfigDb was not accepting writes (#980). Tagged <c>reason=buffer_full</c> and
/// <c>actor</c> (the writer's path). Any non-zero value means <c>ConfigAuditLog</c> is missing rows.
/// </summary>
public static readonly Counter<long> AuditDropped =
Meter.CreateCounter<long>(AuditDroppedName, unit: "{event}",
description: "Audit events dropped by the AuditWriter because its retry buffer was full (reason=buffer_full).");
// ---------------- OPC UA address-space + redundancy ----------------
public static readonly Counter<long> OpcUaSinkWrite =