AWS SNS(Simple Notification Service)
The displayed Metrics of AWS Simple Notification Service include the number of messages successfully delivered from Amazon SNS topics to subscription endpoints, the number of messages failed to be delivered by Amazon SNS, the number of messages published to your Amazon SNS topics, the size of published messages, etc.
Configuration¶
Permissions¶
For AWS cloud collection permissions, see AWS cloud integration role authorization. The read-only permissions required by this integration are listed below.
sns:ListTopics: Get SNS topic list.sns:GetTopicAttributes: Get SNS topic attributes.tag:GetResources: Read resource tags through the shared tag collection module to supplement asset tags.cloudwatch:ListMetrics: Discover CloudWatch monitoring metrics and dimensions.cloudwatch:GetMetricData: Read in batches: CloudWatch monitoring metric data.
Install Func¶
We recommend enabling hosted Func under Integration - Extensions in Guance. All prerequisites are installed automatically; continue with the script installation.
If deploying Func manually, refer to Manual Deployment of Func
Install Script¶
Prepare AWS AK in advance and authorize access as described in Permissions.
Activate Scripts in Hosted Func¶
- Log in to the Guance console
- Click the 【Integration】 menu and select 【Cloud Account Management】
- Click 【Add Cloud Account】, select 【AWS】, and fill in the required information on the interface. If you have already configured the cloud account information before, ignore this step
- Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check if the relevant configuration information is correct and test again
- Click 【Cloud Account Management】, and you can see the added cloud account in the list. Click the corresponding cloud account to enter the details page
- Click 【Integration】 on the cloud account details page, find
AWS SNS(Simple Notification Service)in theNot Installedlist and click 【Install】 to open the installation form.
Manual Activation Script¶
-
Log in to the Func console, click 【Script Market】, open the Guance script market and search for
integration_aws_sns. -
Click 【Install】, then enter the corresponding parameters: AWS AK ID, AK Secret, and account name.
-
Click 【Deploy Startup Script】 to create the
Startupscript set and configure the corresponding startup scripts automatically. -
After enabling the script, open 【Management / Automatic Trigger Configuration】 to view its automatic trigger configuration. Click 【Execute】 to run it immediately without waiting for the scheduled time. After a short wait, review the task records and logs.
Verification¶
- Under 【Management / Automatic Trigger Configuration】, confirm that the task has an automatic trigger configuration. Review its task records and logs for errors.
- In Guance, check [Infrastructure / Custom] for asset information.
- In Guance, check 【Metrics】 for the corresponding monitoring data.
Metrics¶
After configuring Amazon CloudWatch, the default Measurement is as follows. More Metrics can be collected through configuration:
AWS SNS(Simple Notification Service) metric details
| Metric Name | Description | Unit | Valid Statistics |
|---|---|---|---|
NumberOfNotificationsDelivered |
The number of messages successfully delivered from your Amazon SNS topics to subscription endpoints. For successful delivery, the subscription of the endpoint must accept the message. A subscription can accept a message in the following two cases: a.) It lacks a filter policy or b.) The attributes in its filter policy match the attributes assigned to the message. If the subscription rejects the message, the delivery attempt will not be counted in this metric. | Count | Sum, Average |
NumberOfNotificationsFailed |
The number of messages failed to be delivered by Amazon SNS. For Amazon SQS, email, SMS, or mobile push endpoints, this metric increments by 1 when Amazon SNS stops trying to deliver the message. For HTTP or HTTPS endpoints, this metric includes each failed delivery attempt (including retries after the initial attempt). For all other endpoints, the count increases by 1 when the message delivery fails (regardless of the number of attempts). This metric does not include messages rejected by the subscription filter policy. You can control the number of retries for HTTP endpoints. For more information, see Amazon SNS Message Delivery Retries. | Count | Sum, Average |
NumberOfMessagesPublished |
The number of messages published to your Amazon SNS topics. | Count | Sum |
PublishSize |
The size of published messages. | Bytes | Minimum, Maximum, Average, and Count |