feat: HistorianGateway as the OtOpcUa historian backend (read/write/alarms + continuous historization); retire Wonderware #423
Reference in New Issue
Block a user
Delete Branch "feat/historian-gateway-backend"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Makes HistorianGateway the sole historian read/write backend for OtOpcUa, replacing the
bespoke Wonderware TCP/ArchestrA sidecar. New
ZB.MOM.WW.OtOpcUa.Driver.Historian.Gatewaydriver consumes the published
ZB.MOM.WW.HistorianGateway.Client0.1.0 gRPC package (Gitea feed)behind a thin
IHistorianGatewayClientseam, so every adapter is unit-tested against a fake.What changed
AddServerHistoriannow builds aGatewayHistorianDataSource(
IHistorianDataSource): ReadRaw / ReadProcessed (15 aggregate modes) / ReadAtTime / ReadEventsGatewayAlarmHistorianWriter(IAlarmHistorianWriter) behind theexisting
SqliteStoreAndForwardSink; gRPC status → Ack / RetryPlease / PermanentFail.ContinuousHistorizationRecorderactor (append-before-ack, numeric-only gate, backoff drain)draining to the gateway's
WriteLiveValues, wired into DI + hosted lifecycle withobservable-gauge meters.
IHistorianProvisioningEnsureTags hook fires fromAddressSpaceApplier.Apply()(off the publish thread) for historized tags.ServerHistorianOptionsreshaped to the gateway form (Endpoint / ApiKey / UseTls /AllowUntrustedServerCertificate / CaCertificatePath / CallTimeout) + a new
ContinuousHistorizationconfig section.AdminUI driver surface removed; gateway is the sole backend.
Gateway-side prerequisites
The target gateway must run with
RuntimeDb:Enabled=true(WriteLiveValues) andRuntimeDb:EventReadsEnabled=true(alarm-history reads); the API key must carry scopeshistorian:read,historian:write,historian:tags:write. SupplyServerHistorian__ApiKeyvia env — never commit a key.
Two gates before merge (documented in CLAUDE.md)
Category=LiveIntegrationround-trips(read / write-then-read / alarm SendEvent→ReadEvents) must pass against the live gateway →
wonder-sql-vd03on VPN. They skip cleanly offline. Do not merge until green.nothing until a
SetHistorizedRefs-style feed from the address-space deploy flow lands.Reads and alarms work today; the recorder's value-capture is the remaining piece.
Test plan
dotnet build ZB.MOM.WW.OtOpcUa.slnx— 0 errors (touched projects 0 warnings; the ~381 warningsare the pre-existing legacy-test-project baseline).
AdminUI 514, Core.AlarmHistorian 29.
Host.IntegrationTestsfailure (Modbus-only namespace deploy) is unrelated —verified failing identically on
master.Built task-by-task with classification-driven review (implement → spec/code review → fix) per task.
https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii