Skip to content

Commit

Permalink
Merge pull request lidofinance#261 from lidofinance/fix/critical-miss…
Browse files Browse the repository at this point in the history
…ed-proposes-alert

fix: bug in Critical Missed Proposes alert
  • Loading branch information
AlexanderLukin authored Oct 22, 2024
2 parents 8e5d225 + 81b76a3 commit d189814
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/common/alertmanager/alerts/CriticalMissedProposes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export class CriticalMissedProposes extends Alert {
for (const [operator, operatorResult] of Object.entries(ruleResult)) {
const prevAll = sentAlerts[this.alertname]?.ruleResult[operator]?.all ?? 0;
const prevMissed = sentAlerts[this.alertname]?.ruleResult[operator]?.missed ?? 0;
const prevMissedShare = prevAll === 0 ? 0 : prevMissed / prevAll;

// if math relation of missed to all increased
if (operatorResult.missed / operatorResult.all > prevMissed / prevAll && this.sendTimestamp - prevSendTimestamp > defaultInterval)
if (operatorResult.missed / operatorResult.all > prevMissedShare && this.sendTimestamp - prevSendTimestamp > defaultInterval)
return true;
}
}
Expand Down

0 comments on commit d189814

Please sign in to comment.