AWS Simple Notification Service - SNS Test

Amazon Simple Notification Service (Amazon SNS) is a web service that coordinates and manages the delivery or sending of messages to subscribing endpoints or clients. In Amazon SNS, there are two types of clients - publishers and subscribers—also referred to as producers and consumers. Publishers communicate asynchronously with subscribers by producing and sending a message to a topic, which is a logical access point and communication channel. Subscribers (i.e., web servers, email addresses, Amazon SQS queues, AWS Lambda functions) consume or receive the message or notification over one of the supported protocols (i.e., Amazon SQS, HTTP/S, email, SMS, Lambda) when they are subscribed to the topic.

How SNS Works

Figure 1 : How SNS Works

When using Amazon SNS, you (as the owner) create a topic and control access to it by defining policies that determine which publishers and subscribers can communicate with the topic. A publisher sends messages to topics that they have created or to topics they have permission to publish to. Instead of including a specific destination address in each message, a publisher sends a message to the topic. Amazon SNS matches the topic to a list of subscribers who have subscribed to that topic, and delivers the message to each of those subscribers. Each topic has a unique name that identifies the Amazon SNS endpoint for publishers to post messages and subscribers to register for notifications. Subscribers receive all messages published to the topics to which they subscribe, and all subscribers to a topic receive the same messages.

With Amazon SNS, you also have the ability to send push notification messages directly or through topics to apps on mobile devices. Push notification messages sent to a mobile endpoint can appear in the mobile app as message alerts, badge updates, or even sound alerts. However, SNS has limitations on size of the message which are given below.

If SNS is unable to deliver messages to an endpoint - for instance, if you install a sports app and enable push notifications, but the app is unable to send you the latest score of your favorite team - it is bound to impact user experience with that endpoint. To avoid this, administrators must continuously track the messages that SNS sends, check whether these messages are delivered to/consumed by the endpoints, and in the process, swiftly detect a delivery failure. This is made possible by the AWS Simple Notification Service - SNS test.

By default, this test automatically discovers the topics that are created and monitors the messages published to and delivered by each topic. In the process, the test promptly alerts administrators to a message delivery failure. Additionally, the test also reveals topics that are overloaded with messages and those that are handling messages of large sizes.

Optionally, you can configure this test to report metrics for an app on a mobile device or a push notification platform. This way, you can identify the popular apps using SNS and the push notification service that is popular with SNS. This will also lead you to those apps and platforms to which many messages could not be delivered.

SNS Message Size Limitations

SNS enforces a maximum message size of 256 KB for most transport protocols. If your messages surpass this limit, use S3 or another storage service to store the message and include a reference to it in your SNS message. For handling larger messages, consider utilizing Amazon SQS to buffer and decouple messages.

 

Target of the test: Amazon Cloud

Agent deploying the test : A remote agent

Outputs of the test : One set of results for each message queue

First-level descriptor: AWS Region

Second-level descriptor: Queue name

Configurable parameters for the test
Parameter Description

Test Period

How often should the test be executed.

Host

The host for which the test is to be configured.

Access Type

eG Enterprise monitors the AWS cloud using AWS API. By default, the eG agent accesses the AWS API using a valid AWS account ID, which is assigned a special role that is specifically created for monitoring purposes. Accordingly, the Access Type parameter is set to Role by default. Furthermore, to enable the eG agent to use this default access approach, you will have to configure the eG tests with a valid AWS Account ID to Monitor and the special AWS Role Name you created for monitoring purposes.

Some AWS cloud environments however, may not support the role-based approach. Instead, they may allow cloud API requests only if such requests are signed by a valid Access Key and Secret Key. When monitoring such a cloud environment therefore, you should change the Access Type to Secret. Then, you should configure the eG tests with a valid AWS Access Key and AWS Secret Key.

Note that the Secret option may not be ideal when monitoring high-security cloud environments. This is because, such environments may issue a security mandate, which would require administrators to change the Access Key and Secret Key, often. Because of the dynamicity of the key-based approach, Amazon recommends the Role-based approach for accessing the AWS API.

AWS Account ID to Monitor

This parameter appears only when the Access Type parameter is set to Role. Specify the AWS Account ID that the eG agent should use for connecting and making requests to the AWS API. To determine your AWS Account ID, follow the steps below:

  • Login to the AWS management console. with your credentials.

  • Click on your IAM user/role on the top right corner of the AWS Console. You will see a drop-down menu containing the Account ID (see Figure 2).

    Identifying AWS Account ID

    Figure 2 : Identifying the AWS Account ID

AWS Role Name

This parameter appears when the Access Type parameter is set to Role. Specify the name of the role that you have specifically created on the AWS cloud for monitoring purposes. The eG agent uses this role and the configured Account ID to connect to the AWS Cloud and pull the required metrics. To know how to create such a role, refer to Creating a New Role.

AWS Access Key, AWS Secret Key, Confirm AWS Access Key, Confirm AWS Secret Key

These parameters appear only when the Access Type parameter is set to Secret.To monitor an Amazon cloud instance using the Secret approach, the eG agent has to be configured with the access key and secret key of a user with a valid AWS account. For this purpose, we recommend that you create a special user on the AWS cloud, obtain the access and secret keys of this user, and configure this test with these keys. The procedure for this has been detailed in the Obtaining an Access key and Secret key topic. Make sure you reconfirm the access and secret keys you provide here by retyping it in the corresponding Confirm text boxes.

Proxy Host and Proxy Port

In some environments, all communication with the AWS cloud and its regions could be routed through a proxy server. In such environments, you should make sure that the eG agent connects to the cloud via the proxy server and collects metrics. To enable metrics collection via a proxy, specify the IP address of the proxy server and the port at which the server listens against the Proxy Host and Proxy Port parameters. By default, these parameters are set to none , indicating that the eG agent is not configured to communicate via a proxy, by default.

Proxy User Name, Proxy Password, and Confirm Password

If the proxy server requires authentication, then, specify a valid proxy user name and password in the Proxy User Name and Proxy Password parameters, respectively. Then, confirm the password by retyping it in the Confirm Password text box. By default, these parameters are set to none, indicating that the proxy sever does not require authentication by default.

Proxy Domain and Proxy Workstation

If a Windows NTLM proxy is to be configured for use, then additionally, you will have to configure the Windows domain name and the Windows workstation name required for the same against the Proxy Domain and Proxy Workstation parameters. If the environment does not support a Windows NTLM proxy, set these parameters to none.

Exclude Region

Here, you can provide a comma-separated list of region names or patterns of region names that you do not want to monitor. For instance, to exclude regions with names that contain 'east' and 'west' from monitoring, your specification should be: *east*,*west*

SNS Filter Name

By default, this parameter is set to TopicName. This means that by default, this test will report metrics for each topic that is created. If required, you can override this default setting by choosing one of the following options:

  • Application - With Amazon SNS, push notification messages can be sent either directly or through topics to apps on mobile devices. For Amazon SNS to send notification messages to mobile endpoints, the mobile apps and the platforms with which the apps are registered should be registered with the AWS. To have this test report metrics for all the mobile apps that are registered with AWS and to which push notification messages are actively sent, select the Application option.
  • Platform - With Amazon SNS, push notification messages can be sent either directly or through topics to apps on mobile devices. For Amazon SNS to send notification messages to mobile endpoints, the mobile apps and the platforms with which the apps are registered should be registered with the AWS. To have this test report metrics for all the platforms that are registered with AWS and to which push notification messages are actively sent, select the Platform option. The platforms supported by Amazon SNS are as follows:

    • Amazon Device Messaging (ADM)
    • Apple Push Notification Service (APNS) for both iOS and Mac OS X
    • Baidu Cloud Push (Baidu)
    • Google Cloud Messaging for Android (GCM)
    • Microsoft Push Notification Service for Windows Phone (MPNS)
    • Windows Push Notification Services (WNS)
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Total published messages

By default, this measure indicates the total number of messages published to this topic during the last measurement period.

If the SNS Filter Name chosen is Application, then this measure represents the number of messages published to this app during the last measurement period.

If the SNS Filter Name chosen is Platform, then this measure represents the number of messages published to all apps registered with this platform during the last measurement period.

Number

A high value of this measure is indicative of high messaging activity on a topic/application/platform. A quick comparison across descriptors will point you to the popular topics, applications, or platforms (as the case may be).

Published message size

By default, this measure indicates the average size of all messages published to this topic during the last measurement period.

If the SNS Filter Name chosen is Application, then this measure represents the average size of messages published to this app during the last measurement period.

If the SNS Filter Name chosen is Platform, then this measure represents the average size of messages published to all apps registered with this platform during the last measurement period.

KB

With the exception of SMS messages, Amazon SNS messages can contain up to 256 KB of text data, including XML, JSON and unformatted text.

Each SMS message on the other hand can contain up to 140 bytes.

If you publish a message that exceeds the size limit, Amazon SNS sends it as multiple messages, each fitting within the size limit. Messages are not cut off in the middle of a word but on whole-word boundaries.

Successfully delivered messages

By default, this measure indicates the total number of messages that were successfully consumed by subscribers to this topic, during the last measurement period.

If the SNS Filter Name chosen is Application, then this measure represents the number of messages that were successfully delivered to this app either directly or through topics, during the last measurement period.

If the SNS Filter Name chosen is Platform, then this measure represents the number of messages successfully delivered to all apps registered with this platform, during the last measurement period.

Number

Ideally, the value of this measure should be equal to the value of the 'Total published messages' measure.

Messages that failed to deliver

By default, this measure indicates the number of messages that subscribers to this topic could not consume, during the last measurement period.

If the SNS Filter Name chosen is Application, then this measure represents the number of messages that could not be delivered to this app either directly or through topics, during the last measurement period.

If the SNS Filter Name chosen is Platform, then this measure represents the number of messages that could not be delivered to all apps registered with this platform, during the last measurement period.

Number

Ideally, the value of this measure should be 0. A non-zero value implies that one/more messages could not be delivered to the endpoints.

Typically, if Amazon SNS does not receive a successful response from an endpintint, it attempts to deliver the message again. This applies to all messages, including the subscription confirmation message. By default, if the initial delivery of the message fails, Amazon SNS attempts up to three retries with a delay between failed attempts set at 20 seconds. Note that the message request times out at 15 seconds. This means that if the message delivery failure was caused by a timeout, Amazon SNS will retry approximately 35 seconds after the previous delivery attempt. If you do not like the default delivery policy, you can set a different delivery policy on the endpoint.

If a delivery to an Amazon SQS, email, SMS, or mobile push endpoint fails, then this measure will disregard all re-delivery attempts that follow. In other words, the value of this measure increases by 1 only if message delivery fails the first time; retries will not impact the value of this measure. On the other hand, if a delivery to an HTTP/HTTPS endpoint fails, then the value of this measure will be incremented by 1 for every subsequent delivery retry as well.

To troubleshoot the failure of message deliveries to Application, HTTP, Lambda, and SQS endpoints, you need to enable Amazon SNS delivery status logging. This can be achieved using the AWS Management Console, AWS SDKs, or the AWS CLI.

Successfully delivered SMS

By default, this measure indicates the total number of successful SMS message deliveries made to subscribers of this topic, during the last measurement period.

If the SNS Filter Name chosen is Application, then this measure represents the number of successful SMS message deliveries made to this app during the last measurement period.

If the SNS Filter Name chosen is Platform, then this measure represents the number of successful SMS message deliveries made to all apps registered with this platform, during the last measurement period.

Number

Ideally, the value of this measure should be high. A very low value indicates many SMS delivery failures.