From e9d997d4c9b867c37af46a0c8cb4bf6355cdb60a Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Wed, 19 Jun 2024 19:20:11 +0800 Subject: [PATCH] feat(monitor): add reducer of AlertRecordRule (#20582) --- pkg/apis/monitor/alertrecord.go | 1 + pkg/monitor/alerting/rule.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/apis/monitor/alertrecord.go b/pkg/apis/monitor/alertrecord.go index 34784350d2..1dc9e95032 100644 --- a/pkg/apis/monitor/alertrecord.go +++ b/pkg/apis/monitor/alertrecord.go @@ -96,4 +96,5 @@ type AlertRecordRule struct { ConditionType string `json:"condition_type"` // 静默期 SilentPeriod string `json:"silent_period"` + Reducer string `json:"reducer"` } diff --git a/pkg/monitor/alerting/rule.go b/pkg/monitor/alerting/rule.go index ffec3bc482..70b138308d 100644 --- a/pkg/monitor/alerting/rule.go +++ b/pkg/monitor/alerting/rule.go @@ -191,6 +191,7 @@ func newRuleDescription(rule *Rule, alertDetails *monitor.CommonAlertMetricDetai Comparator: alertDetails.Comparator, Threshold: RationalizeValueFromUnit(alertDetails.Threshold, alertDetails.FieldDescription.Unit, ""), ConditionType: alertDetails.ConditionType, + Reducer: alertDetails.Reduce, }, } if len(ruleDes.ResType) == 0 {