worker(alarms): synthetic GUID + degraded/source_provider on emitted transitions

This commit is contained in:
Joseph Doherty
2026-06-13 09:14:23 -04:00
parent 60d35a914f
commit 57d5a8725f
6 changed files with 142 additions and 3 deletions
@@ -86,6 +86,12 @@ public sealed class MxAccessAlarmEventSink : IMxAccessEventSink
/// <param name="operatorComment">The operator's comment, if any.</param>
/// <param name="category">The alarm category.</param>
/// <param name="description">The alarm description.</param>
/// <param name="degraded">
/// <see langword="true"/> when the transition was synthesized by the
/// subtag-provider fallback rather than the native alarmmgr path.
/// Defaults to <see langword="false"/> so existing alarmmgr callers
/// compile unchanged and stay on the parity (alarmmgr) path.
/// </param>
internal void EnqueueTransition(
string alarmFullReference,
string sourceObjectReference,
@@ -97,10 +103,16 @@ public sealed class MxAccessAlarmEventSink : IMxAccessEventSink
string operatorUser,
string operatorComment,
string category,
string description)
string description,
bool degraded = false)
{
try
{
// Degraded transitions come from the subtag fallback; the native
// alarmmgr (wnwrap) path stays degraded=false / ALARMMGR for parity.
AlarmProviderMode sourceProvider = degraded
? AlarmProviderMode.Subtag
: AlarmProviderMode.Alarmmgr;
MxEvent mxEvent = eventMapper.CreateOnAlarmTransition(
sessionId,
alarmFullReference,
@@ -114,7 +126,9 @@ public sealed class MxAccessAlarmEventSink : IMxAccessEventSink
operatorComment,
category,
description,
statuses: null);
statuses: null,
degraded: degraded,
sourceProvider: sourceProvider);
eventQueue.Enqueue(mxEvent);
}
catch (Exception exception)