Monitoring SMS spending activity with Amazon Pinpoint - Amazon Pinpoint

Monitoring SMS spending activity with Amazon Pinpoint

This topic provides information about viewing SMS spending metrics in Amazon CloudWatch. It also explains how to set up a CloudWatch alarm that sends you a notification when your monthly SMS spending exceeds a certain amount.

View your monthly SMS spending by using CloudWatch

To quickly determine how much money you've spent sending SMS messages during the current month, you can use the Metrics section of the CloudWatch console. CloudWatch retains metrics data for 15 months, so you can view real-time data and analyze historical trends.

For more information about viewing metrics in CloudWatch, see Using Amazon CloudWatch metrics in the Amazon CloudWatch User Guide.

To view SMS spending metrics in CloudWatch

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. In the navigation pane, choose Metrics.

  3. On the All metrics tab, choose SNS.

  4. Choose Metrics with no dimensions.

  5. Select SMSMonthToDateSpentUSD. The graph updates to display the amount of money that you've spent sending SMS messages during the current month by using Amazon Pinpoint and Amazon Simple Notification Service (Amazon SNS).

    Note

    The SMSMonthToDateSpentUSD metric doesn't appear until you send at least one SMS message by using Amazon Pinpoint or Amazon SNS.

Create an SMS spending alarm by using CloudWatch

In addition to viewing your monthly SMS spending metrics, you can create CloudWatch alarms that notify you when your SMS spending exceeds a certain amount. You can set up CloudWatch to deliver these notifications to you by sending them to an Amazon SNS topic.

For more information about creating alarms in CloudWatch, see Using Amazon CloudWatch alarms in the Amazon CloudWatch User Guide.

To create an SMS spending alarm in CloudWatch

  1. If you haven't already done so, create an Amazon SNS topic and subscribe an endpoint to it. The endpoint that you subscribe to the topic should be the location where you want to receive spending notifications. For example, if you want to receive spending notifications by email, subscribe your email address to the Amazon SNS topic. If you want to receive spending notifications by text message, subscribe an SMS endpoint to the topic.

    For information about creating and subscribing to topics, see Getting started with Amazon SNS in the Amazon Simple Notification Service Developer Guide.

  2. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  3. In the navigation pane, under Alarms, choose Billing.

  4. Next to Billing alarms, choose Create alarm.

  5. Choose Select metric.

  6. On the All metrics tab, choose SNS, and then choose Metrics with no dimensions.

  7. Select SMSMonthToDateSpentUSD.

    Note

    The SMSMonthToDateSpentUSD metric doesn't appear until you send at least one SMS message by using Amazon Pinpoint or Amazon SNS.

  8. Choose the Graphed metrics tab, and then complete the following steps:

    • Under Statistic, choose the statistic or predefined percentile that you want to monitor, or specify a custom percentile—for example, p99 or p45.

    • Under Period, choose the evaluation period for the alarm. When evaluating the alarm, each period is aggregated into one datapoint.

  9. Choose Select metric. The Specify metric and conditions page appears, showing a graph and other information about the metric and statistic for the alarm.

  10. Under Conditions, complete the following steps:

    • For Threshold type, choose Static.

    • For Whenever SMSMonthToDateSpentUSD is, specify whether you want the metric to be greater than, greater than or equal to, or equal to the threshold in order to trigger the alarm. Then, under than, enter the threshold value, which is the dollar amount (in US Dollars) that you want to trigger the alarm.

  11. Under Additional configuration, complete the following steps:

    • For Datapoints to alarm, enter the number of evaluation periods (datapoints) during which the spending amount must exceed the threshold to trigger the alarm.

    • For Missing data treatment, choose Treat missing data as ignore (maintain the alarm state).

  12. Choose Next.

  13. Under Notification, complete the following steps:

    • For Whenever this alarm state is, choose in Alarm.

    • For Select an SNS topic, choose the Amazon SNS topic that you want the alarm notification to be sent to.

  14. Choose Next.

  15. Enter a name and, optionally, a description for the alarm, and then choose Next.

  16. Under Preview and create, review and confirm that the alarm settings are what you want, and then choose Create alarm.