feat(telemetry): deploy-failure, S&F activity, script-run and DCL-transition instruments (ScadaBridge#81)
Adds four instruments on the already-allow-listed ZB.MOM.WW.ScadaBridge meter:
scadabridge.deployments.failed{reason}, scadabridge.store_and_forward.activity{action,category},
scadabridge.site.script.runs{outcome} + scadabridge.site.script.duration{outcome} (ms),
scadabridge.site.data_connections.transitions{state}. Queue depth, DCL connection state and
deploy-applied already existed. No new Meter, so ZbTelemetryOptions.Meters needs no change.
Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -631,6 +631,11 @@ public class DeploymentService
|
||||
await _repository.SaveChangesAsync(cancellationToken);
|
||||
NotifyStatusChange(record);
|
||||
|
||||
if (response.Status != DeploymentStatus.Success)
|
||||
{
|
||||
ScadaBridgeTelemetry.RecordDeploymentFailed("site_failed");
|
||||
}
|
||||
|
||||
if (response.Status == DeploymentStatus.Success)
|
||||
{
|
||||
// Telemetry: one instance deployment successfully applied to a
|
||||
@@ -721,6 +726,7 @@ public class DeploymentService
|
||||
string user,
|
||||
Exception cause)
|
||||
{
|
||||
ScadaBridgeTelemetry.RecordDeploymentFailed(IsTimeoutFault(cause) ? "timeout" : "error");
|
||||
record.Status = DeploymentStatus.Failed;
|
||||
record.ErrorMessage = IsTimeoutFault(cause)
|
||||
? $"{TimeoutFailurePrefix} {cause.Message}"
|
||||
|
||||
Reference in New Issue
Block a user