fix(historian): latch the recorder's dropped-kind Debug log per run; pin the outbox.unreadable gauge

The DroppedUnsupportedKind counter still counts every value; only the Debug
line is latched (cleared by the next captured value), so a Gateway-backend
comms loss no longer logs one line per tag.

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-09 14:23:42 -04:00
parent 7c787b8b64
commit 96ec751a0b
2 changed files with 73 additions and 1 deletions
@@ -196,6 +196,12 @@ public sealed class ContinuousHistorizationRecorder : ReceiveActor, IWithTimers
/// the first item that ingests cleanly — see <see cref="IngestAsync"/>.</summary>
private bool _ingestFaultLogged;
/// <summary>Whether the current run of unsupported-kind drops has already been logged, so a backend that
/// drops a whole class of value (every comms-loss marker on the Gateway backend, say) logs once per run rather
/// than once per value. The <see cref="_droppedUnsupportedKind"/> counter still counts every value. Cleared by
/// the next value that is captured.</summary>
private bool _droppedKindLogged;
/// <summary>Last observed state of <see cref="_captureGate"/>, so a change is logged once rather
/// than on every value. Seeded open: a gate that starts closed logs its first suppression.</summary>
private bool _captureGateOpen = true;
@@ -553,10 +559,18 @@ public sealed class ContinuousHistorizationRecorder : ReceiveActor, IWithTimers
// (e.g. String/Empty on the gateway's numeric-only SQL analog path) — drop and meter. No value
// content is logged.
_droppedUnsupportedKind++;
_log.Debug("ContinuousHistorization: dropped a value of a kind the historian backend does not support.");
if (!_droppedKindLogged)
{
_droppedKindLogged = true;
_log.Debug("ContinuousHistorization: dropped a value of a kind the historian backend does not support. "
+ "Further drops are only counted (DroppedUnsupportedKind) until a value is captured.");
}
return;
}
_droppedKindLogged = false;
var timestampUtc = DateTime.SpecifyKind(msg.TimestampUtc, DateTimeKind.Utc);
entries ??= new List<HistorizationOutboxEntry>();