Amazon Simple Notification Service (SNS)

SNS Dashboard

Overview

Connect Amazon Simple Notification Service (SNS) to Datadog in order to:

  • See SNS messages as events in your Event Explorer
  • Send alert and event notifications to SNS

Setup

Installation

If you haven’t already, set up the Amazon Web Services integration first.

Metric collection

  1. In the AWS integration page, ensure that SNS is enabled under the Metric Collection tab.

  2. Add the following permissions to your Datadog IAM policy in order to collect Amazon SNS metrics. For more information, see the SNS policies on the AWS website.

    AWS PermissionDescription
    sns:ListTopicsUsed to list available topics.
    sns:PublishUsed to publish notifications (monitors or event feed).
  3. Install the Datadog - Amazon SNS integration.

Event collection

Receive SNS messages

You can receive SNS messages in the Datadog Event Explorer through both the HTTPS and Email protocols. Using the HTTPS protocol allows you to automatically confirm the subscription with a webhook URL.

Using the Email protocol requires a manual confirmation step for the email address that Datadog automatically generates for this purpose. Read the Create Datadog Events from Amazon SNS Emails guide for more information.

To receive SNS messages in the Datadog Event Explorer through HTTPS:

  1. In the Topics section of the SNS Management console, select the desired topic and click Create Subscription.

  2. Select HTTPS as the protocol and enter the following webhook URL, substituting <API_KEY> with the value of any valid Datadog API key:

    ## Datadog US site
    https://app.datadoghq.com/intake/webhook/sns?api_key=<API_KEY>
    
    ## Datadog EU site
    https://app.datadoghq.eu/intake/webhook/sns?api_key=<API_KEY>
    
  3. Leave Enable raw message delivery unchecked.

  4. Click Create subscription.

Send SNS notifications

To send SNS notifications from Datadog:

  1. Configure the AWS account that is associated with an SNS service on the AWS integration page.
  2. Install the SNS integration.
  3. Datadog then detects your configured SNS topics and enables @notifications, for example: @sns-topic-name.

Log collection

SNS does not provide logs. Process logs and events that are transiting through to the SNS.

Send logs to Datadog

  1. Configure a new SNS subscription.
  2. Select the topic where messages come from.
  3. For the Protocol, select AWS Lambda.
  4. For the Endpoint, enter the ARN of your Datadog Forwarder Lambda function.

Data Collected

Metrics

aws.sns.dwell_time
(gauge)
Time waited by a message before it was delivered.
Shown as millisecond
aws.sns.number_of_messages_published
(count)
Number of messages published.
Shown as message
aws.sns.number_of_notifications_delivered
(count)
Number of messages successfully delivered.
Shown as message
aws.sns.number_of_notifications_failed
(count)
Number of messages that SNS failed to deliver.
Shown as message
aws.sns.number_of_notifications_filtered_out
(count)
The number of messages that were rejected by subscription filter policies. A filter policy rejects a message when the message attributes don't match the policy attributes.
Shown as message
aws.sns.number_of_notifications_filtered_out_invalid_attributes
(count)
The number of messages that were rejected by subscription filter policies because the messages have no attributes.
Shown as message
aws.sns.number_of_notifications_filtered_out_no_message_attributes
(count)
The number of messages that were rejected by subscription filter policies. A filter policy rejects a message when the message attributes don't match the policy attributes.
Shown as message
aws.sns.publish_size
(gauge)
Size of messages published.
Shown as byte
aws.sns.smssuccess_rate
(gauge)
The percentage of successfully delivered sms.
Shown as percent

Each of the metrics retrieved from AWS is assigned the same tags that appear in the AWS console, including but not limited to host name, security-groups, and more.

Events

The Amazon SNS integration includes events for topic subscriptions. See the example event below:

Amazon SNS Events

Service Checks

The Amazon SNS integration does not include any service checks.

Troubleshooting

Datadog does not support SNS notifications from Datadog to topics in China.

Need help? Contact Datadog support.