Update config docs to clarify fifo SNS deduplication strategy. Remove extra api call get topic attributes and use '.fifo' strategy instead

Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
This commit is contained in:
Tyler Reid 2021-06-27 20:26:44 -05:00
parent 25e6d4efd9
commit 208bed6dee
2 changed files with 3 additions and 9 deletions

View File

@ -708,6 +708,8 @@ sigv4:
# SNS topic ARN, i.e. arn:aws:sns:us-east-2:698519295917:My-Topic
# If you don't specify this value, you must specify a value for the phone_number or target_arn.
# If you are using a FIFO SNS topic you should set a message group interval longer than 5 minutes
# to prevent messages with the same group key being deduplicated by the SNS default deduplication window
[ topic_arn: <tmpl_string>]
# Subject line when the message is delivered to email endpoints.

View File

@ -117,15 +117,7 @@ func (n *Notifier) Notify(ctx context.Context, alert ...*types.Alert) (bool, err
publishInput.SetTopicArn(topicTmpl)
if n.isFifo == nil {
checkFifo, err := checkTopicFifoAttribute(client, topicTmpl)
if err != nil {
if e, ok := err.(awserr.RequestFailure); ok {
return n.retrier.Check(e.StatusCode(), strings.NewReader(e.Message()))
} else {
return true, err
}
}
n.isFifo = &checkFifo
n.isFifo = aws.Bool(n.conf.TopicARN[len(n.conf.TopicARN)-5:] == ".fifo")
}
if *n.isFifo {
// Deduplication key and Message Group ID are only added if it's a FIFO SNS Topic.