@@ -16,11 +16,13 @@ import (
16
16
)
17
17
18
18
type RuleAnnotation struct {
19
- CheckPoint string `yaml:"CheckPoint"`
20
- Description string `yaml:"description"`
21
- Discriminative string `yaml:"discriminative"`
22
- Message string `yaml:"message"`
23
- Summary string `yaml:"summary"`
19
+ CheckPoint string `yaml:"CheckPoint"`
20
+ Description string `yaml:"description"`
21
+ Discriminative string `yaml:"discriminative"`
22
+ Message string `yaml:"message"`
23
+ Summary string `yaml:"summary"`
24
+ AlertType string `json:"alertType"`
25
+ SystemNotificationRuleId string `json:"systemNotificationRuleId"`
24
26
}
25
27
26
28
type RuleLabels struct {
@@ -104,10 +106,12 @@ func processSystemNotificationRule() error {
104
106
Expr : expr ,
105
107
For : rule .SystemNotificationCondition .Duration ,
106
108
Annotations : RuleAnnotation {
107
- CheckPoint : replaceMetricParameter (rule .SystemNotificationTemplate .MetricParameters , rule .MessageActionProposal ),
108
- Description : replaceMetricParameter (rule .SystemNotificationTemplate .MetricParameters , rule .MessageContent ),
109
- Message : replaceMetricParameter (rule .SystemNotificationTemplate .MetricParameters , rule .MessageTitle ),
110
- Discriminative : discriminative ,
109
+ CheckPoint : replaceMetricParameter (rule .SystemNotificationTemplate .MetricParameters , rule .MessageActionProposal ),
110
+ Description : replaceMetricParameter (rule .SystemNotificationTemplate .MetricParameters , rule .MessageContent ),
111
+ Message : replaceMetricParameter (rule .SystemNotificationTemplate .MetricParameters , rule .MessageTitle ),
112
+ Discriminative : discriminative ,
113
+ AlertType : rule .NotificationType ,
114
+ SystemNotificationRuleId : rule .ID .String (),
111
115
},
112
116
Labels : RuleLabels {
113
117
Severity : rule .SystemNotificationCondition .Severity ,
@@ -178,7 +182,7 @@ func processSystemNotificationRule() error {
178
182
organizationRuleIds = append (organizationRuleIds , r .ID )
179
183
}
180
184
}
181
- err = systemNotificationRuleAccessor .UpdateSystemNotificationRuleStatus (organizationRuleIds , domain .SystemNotificationRuleStatus_APPLYED )
185
+ err = systemNotificationRuleAccessor .UpdateSystemNotificationRuleStatus (organizationRuleIds , domain .SystemNotificationRuleStatus_APPLIED )
182
186
if err != nil {
183
187
log .Error (context .TODO (), err )
184
188
continue
0 commit comments