Skip to content

Commit

Permalink
Removing changes to rule registry
Browse files Browse the repository at this point in the history
  • Loading branch information
doakalexi committed Jan 12, 2024
1 parent 89cc726 commit 275520b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,7 @@ export const createLifecycleExecutor =
const flapping = isFlapping(flappingSettings, flappingHistory, isCurrentlyFlapping);
return [
alertId,
{
alertId,
alertUuid,
started,
flappingHistory,
flapping,
pendingRecoveredCount,
},
{ alertId, alertUuid, started, flappingHistory, flapping, pendingRecoveredCount },
];
})
);
Expand All @@ -430,14 +423,7 @@ export const createLifecycleExecutor =
const flapping = isFlapping(flappingSettings, flappingHistory, isCurrentlyFlapping);
return [
alertId,
{
alertId,
alertUuid,
started,
flappingHistory,
flapping,
pendingRecoveredCount,
},
{ alertId, alertUuid, started, flappingHistory, flapping, pendingRecoveredCount },
];
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ export function getAlertsForNotification(
return trackedEventsToIndex.map((trackedEvent) => {
if (!flappingSettings.enabled || trackedEvent.event[ALERT_STATUS] === ALERT_STATUS_ACTIVE) {
trackedEvent.pendingRecoveredCount = 0;
} else if (trackedEvent.event[ALERT_STATUS] === ALERT_STATUS_RECOVERED) {
if (flappingSettings.enabled && trackedEvent.flapping) {
} else if (
flappingSettings.enabled &&
trackedEvent.event[ALERT_STATUS] === ALERT_STATUS_RECOVERED
) {
if (trackedEvent.flapping) {
const count = trackedEvent.pendingRecoveredCount || 0;
trackedEvent.pendingRecoveredCount = count + 1;
if (trackedEvent.pendingRecoveredCount < flappingSettings.statusChangeThreshold) {
Expand Down

0 comments on commit 275520b

Please sign in to comment.