SNS receiver message validation and truncation rules - Amazon Managed Service for Prometheus

SNS receiver message validation and truncation rules

SNS messages will be validated, truncated, or modified, if necessary, by the SNS receiver based on the following rules:

  • Message contains non-utf characters.

    • Message will be replaced by "Error - not a valid UTF-8 encoded string."

    • One message attribute will be added with the key of "truncated" and the value of "true"

    • One message attribute will be added with the key of "modified" and the value of "Message: Error - not a valid UTF-8 encoded string."

  • Message is empty.

    • Message will be replaced by "Error - Message should not be empty."

    • One message attribute will be added with the key of "modified" and the value of "Message: Error - Message should not be empty."

  • Message has been truncated.

    • Message will have the truncated content.

    • One message attribute will be added with the key of "truncated" and the value of "true"

    • One message attribute will be added with the key of "modified" and the value of "Message: Error - Message has been truncated from X KB, because it exceeds the 256 KB size limit."

  • Subject is not ASCII.

    • Subject will be replaced by "Error - contains non printable ASCII characters."

    • One message attribute will be added with the key of "modified" and the value of "Subject: Error - contains non-printable ASCII characters."

  • Subject has been truncated.

    • Subject will have the truncated content.

    • One message attribute will be added with the key of "modified" and the value of "Subject: Error - Subject has been truncated from X characters, because it exceeds the 100 character size limit."

  • Message attribute has invalid key/value.

    • Invalid message attribute will be removed.

    • One message attribue will be added with the key of "modified" and the value of "MessageAttribute: Error - X of the message attributes have been removed becasue of invalid MessageAttributeKey or MessageAttributeValue."

  • Message attribute has been truncated.

    • Extra message attributes will be removed.

    • One message attribute will be added with the key of "modified" and the value of "MessageAttribute: Error - X of the message attributes have been removed, because it exceeds the 256KB size limit.