feat(grpc-data): H4 remote-history diagnostics and metrics
Consumer and origin history evidence for data connections (plan §6):
- DataConnectionHistoryDiagnostics: otopcua.dataconn.history.reads{variant,status_class,side} and
otopcua.dataconn.history.continuations.active{side} on the exported OtOpcUa meter (the H2 origin
counter sat on a private meter the host never exported); the plan's unknown-bits counter is the
existing X0 otopcua.dataconnection.unknown_operations_dropped, reused
- per-connection projected answers by status class and open consumer continuations (settled on
resume claim or release); origin sessions, open continuations and answers by status class
- negotiated features and advertised history variants/aggregates per connection
- AdminUI data-connections page renders them plus the dropped unknown-operation bits (#919)
- H4 unit-phase manifest key
This commit is contained in:
+29
-1
@@ -35,7 +35,9 @@ else
|
||||
@if (live.Row.Serving is { } serving) { <span> · serving @serving.NodeId · role @serving.Role · incarnation @serving.Incarnation</span> }
|
||||
<div>Streams @live.Row.ActiveStreams · calls @live.Row.ActiveCalls · retained import views @Measure(live.Row.SourceCount) · registrations @Measure(live.Row.RegistrationCount) · resets @Measure(live.Row.ResetCount) · coalesced notices @Measure(live.Row.CoalescedCount) · overflows @Measure(live.Row.OverflowCount)</div>
|
||||
<div>Writes succeeded @Measure(live.Row.WriteSucceededCount) · rejected @Measure(live.Row.WriteRejectedCount) · failed @Measure(live.Row.WriteFailedCount) · unconfirmed @Measure(live.Row.WriteUnconfirmedCount) · unknown @Measure(live.Row.WriteUnknownCount)</div>
|
||||
<div>Last observed sample bound @Time(live.Row.LastSampleAtUtc) (age upper bound @DataConnectionDiagnostics.SampleAge(live.Row)) · metadata lease expires @Time(live.Row.MetadataLeaseExpiresAtUtc) · last handshake @Time(live.Row.LastVerifiedAtUtc) · observed @live.Row.AsOfUtc.ToString("u") · artifact @live.Row.ArtifactRevision · protocol @(live.Row.ProtocolMajor is { } major && live.Row.ProtocolMinor is { } minor ? $"{major}.{minor}" : "unavailable")</div></div>
|
||||
<div>Last observed sample bound @Time(live.Row.LastSampleAtUtc) (age upper bound @DataConnectionDiagnostics.SampleAge(live.Row)) · metadata lease expires @Time(live.Row.MetadataLeaseExpiresAtUtc) · last handshake @Time(live.Row.LastVerifiedAtUtc) · observed @live.Row.AsOfUtc.ToString("u") · artifact @live.Row.ArtifactRevision · protocol @(live.Row.ProtocolMajor is { } major && live.Row.ProtocolMinor is { } minor ? $"{major}.{minor}" : "unavailable")</div>
|
||||
<div class="data-connection-history">Negotiated features @DataConnectionDiagnostics.Features(live.Row.NegotiatedFeatures) · origin history @DataConnectionDiagnostics.HistoryServed(live.Row) · projected history reads @DataConnectionDiagnostics.HistoryCounts(live.Row.HistoryReadsGood, live.Row.HistoryReadsUncertain, live.Row.HistoryReadsBad) · open remote continuations (local sessions) @Measure(live.Row.OpenRemoteContinuations)</div>
|
||||
<div class="@(DataConnectionDiagnostics.HasDrops(live.Row.DroppedUnknownOperations, live.Row.MappingsWithDroppedOperations) ? "notice data-connection-dropped" : "data-connection-dropped")">Dropped unknown operation bits: connection @DataConnectionDiagnostics.DroppedBits(live.Row.DroppedUnknownOperations) · mappings with dropped bits @Measure(live.Row.MappingsWithDroppedOperations)@if (DataConnectionDiagnostics.HasDrops(live.Row.DroppedUnknownOperations, live.Row.MappingsWithDroppedOperations)) { <span> — this node's build is older than a feature authored here; the dropped bits grant nothing until the node is upgraded.</span> }</div></div>
|
||||
}
|
||||
@foreach (var applied in _applied.Where(x => Same(x.ConnectionId, row.Id))) { <span class="small">@applied.NodeId: last applied revision @applied.Revision (@(applied.Enabled ? "enabled" : "disabled"))</span> }
|
||||
@if (row.Draft is { } editable) { <AuthorizeView Policy="@AdminUiPolicies.ConfigEditor"><button class="btn btn-sm btn-outline-primary" @onclick="() => Edit(editable)">Edit</button></AuthorizeView> }</div>
|
||||
@@ -43,6 +45,30 @@ else
|
||||
<AuthorizeView Policy="@AdminUiPolicies.ConfigEditor"><button class="btn btn-sm btn-primary" @onclick="NewConnection">New connection</button></AuthorizeView>
|
||||
</div>
|
||||
</section>
|
||||
<section class="panel mt-3">
|
||||
<h2 class="panel-head">Origin evidence by node</h2><div class="p-3">
|
||||
@if (!_nodeSnapshots.Any()) { <p class="text-muted">No node has reported.</p> }
|
||||
@foreach (var (nodeId, node) in _nodeSnapshots)
|
||||
{
|
||||
<div class="small mb-2 data-connection-origin"><strong>@nodeId</strong>
|
||||
@if (node.OriginHistory is { } origin)
|
||||
{
|
||||
<span> · remote history @(origin.Available ? "served" : "no historian backend") · peer history sessions @origin.Sessions · open origin continuations @origin.OpenContinuations · history items answered @DataConnectionDiagnostics.HistoryCounts(origin.ReadsGood, origin.ReadsUncertain, origin.ReadsBad)</span>
|
||||
}
|
||||
else { <span> · remote history evidence unavailable</span> }
|
||||
@if (node.DroppedExportOperations is { } dropped)
|
||||
{
|
||||
@if (dropped.Count == 0) { <span> · dropped unknown export bits: none</span> }
|
||||
else
|
||||
{
|
||||
<div class="notice" role="note">Exports with dropped unknown operation bits: @string.Join("; ", dropped.OrderBy(x => x.Key, StringComparer.OrdinalIgnoreCase).Select(x => $"{x.Key}: {DataConnectionDiagnostics.DroppedBits(x.Value)}")) — this node's build is older than a feature authored here; the dropped bits grant nothing until the node is upgraded.</div>
|
||||
}
|
||||
}
|
||||
else { <span> · dropped unknown export bits unavailable</span> }
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
<section class="panel mt-3">
|
||||
<h2 class="panel-head">Exports</h2><div class="p-3">
|
||||
@if (!Exports.Any()) { <p class="text-muted">No export grants have been authored.</p> }
|
||||
@@ -125,6 +151,7 @@ else
|
||||
private object? _deleteCandidate;
|
||||
private IReadOnlyList<AppliedConnection> _applied = [];
|
||||
private List<(string NodeId, DataConnectionDiagnosticsSnapshot Row)> _live = [];
|
||||
private List<(string NodeId, NodeDiagnosticsSnapshot Snapshot)> _nodeSnapshots = [];
|
||||
private IReadOnlyList<ConnectionDisplayRow> ConnectionRows => DataConnectionDiagnostics.Rows(Connections, _applied.Select(x => x.ConnectionId), _live.Select(x => x.Row.ConnectionId));
|
||||
private IEnumerable<DataConnection> Connections => _snapshot!.DataConnections.Where(x => Same(x.ClusterId, ClusterId));
|
||||
private IEnumerable<DataExport> Exports => _snapshot!.DataExports.Where(x => Same(x.ClusterId, ClusterId));
|
||||
@@ -139,6 +166,7 @@ else
|
||||
try { return (node.NodeId, Snapshot: (NodeDiagnosticsSnapshot?)await Diagnostics.GetDiagnosticsAsync(NodeId.Parse($"{node.Host}:{node.AkkaPort}"), CancellationToken.None)); }
|
||||
catch (Exception) { return (node.NodeId, Snapshot: (NodeDiagnosticsSnapshot?)null); }
|
||||
}));
|
||||
_nodeSnapshots = observations.Where(x => x.Snapshot is not null).Select(x => (x.NodeId, x.Snapshot!)).ToList();
|
||||
_live = observations.Where(x => x.Snapshot?.DataConnections is not null)
|
||||
.SelectMany(x => x.Snapshot!.DataConnections!.Select(row => (x.NodeId, row))).ToList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user