Remove field limitation from slack notification (#33113)
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user