prometheus / prometheus/alertmanager

Prometheus SNS receiver validation

Open
#2,781 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

component/notify stale
Dominant language
Go
Stars
8.6k
Forks
2.5k
Avg merge
2d 6h
Merged PRs (30d)
61

Description

Problem

Right now SNS message will only be truncated because of message body size limit. We have a messageAttribute with key "truncated" set to indicate if a message has been truncated or not here However it could be other part of the message could be truncated

  1. Message attribute size is limit to 256KB with message body. See reference here: All parts of the message attribute, including name, type, and value, are included in the message size restriction, which is 256 KB.
  2. Subject: Subjects must be ASCII text that begins with a letter, number, or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long

In order to send out the message by best effort(we prefer to truncate the message than not sending out the message), and also to give users a better understanding of what's has been truncated and the reason. I purpose to change/add more attributes to indicate different part of a SNS message truncate/remove status

Purposal

Keep the existing messageAttributes["truncated"]

In case of the concern of backward compatibility, we will still keep messageAttributes["truncated"] and this will remain indication of the message body truncation or not.
The other truncation status will be in another new messageAttribute with key "modified" and value will be the a list of [message section: modify reason].
For example if both message subject + message attribute has been modified. We will set messageAttributes["modified"]=["subject: Max message size limit exceed", "messageAttribute: Invalid non-alphanumeric character was found in the message attribute name. Can only include alphanumeric characters, hyphens, underscores, or dots."]

Remove the existing messageAttributes["truncated"]

We will remove the existing messageAttributes and add a new messageAttribute with key "modified" and value will be the a list of [message section: modify reason].
For example if both message subject + message body has been modified. We will set messageAttributes["modified"]=["subject: Max message size limit exceed", "message: Max message size limit exceed"]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with notify/sns/sns.go at the existing truncated message attribute handling. Review the proposed SNS subject, message body, and message-attribute limits and decide which compatibility option is intended. Done means truncation or removal reasons are reported consistently while preserving the required existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
backend, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.