Remove field limitation from slack notification (#33113)

This commit is contained in:
Dimitris Sotirakis
2021-04-20 12:01:05 +03:00
committed by GitHub
parent 04781bfcc6
commit b3ce655b67
+1 -5
View File
@@ -198,16 +198,12 @@ func (sn *SlackNotifier) Notify(evalContext *alerting.EvalContext) error {
} }
fields := make([]map[string]interface{}, 0) fields := make([]map[string]interface{}, 0)
fieldLimitCount := 4 for _, evt := range evalContext.EvalMatches {
for index, evt := range evalContext.EvalMatches {
fields = append(fields, map[string]interface{}{ fields = append(fields, map[string]interface{}{
"title": evt.Metric, "title": evt.Metric,
"value": evt.Value, "value": evt.Value,
"short": true, "short": true,
}) })
if index > fieldLimitCount {
break
}
} }
if evalContext.Error != nil { if evalContext.Error != nil {