Monitoring
AWS End User Messaging gives you two complementary views of your SMS messaging, plus a record of your API activity and a way to report message outcomes. This topic describes how to set up each one.
| What you monitor | How it works |
|---|---|
Overall delivery health |
Amazon CloudWatch metrics aggregate your sending into near real-time numbers (parts sent and delivered, spend, and messages blocked) that you watch on dashboards and alarm on. |
Granular per-message events |
Message events report what happened to each individual message as it is sent and delivered. You route them to a destination with a configuration set, or consume them from Amazon EventBridge. |
API activity |
AWS CloudTrail logs the AWS End User Messaging API calls made in your account. |
Outcome feedback |
Message feedback lets you report whether each message reached its intended outcome, so you can track conversion and improve the deliverability signals AWS End User Messaging uses. |
Monitoring with CloudWatch
You can monitor AWS End User Messaging using CloudWatch, which collects raw data and processes it into readable,
near real-time metrics. CloudWatch retains metric data for 15 months, so you can access historical
information and gain a better perspective on how your application is performing. The namespace for
AWS End User Messaging metrics is AWS/SMSVoice. The following table lists common SMS metrics you
can monitor. For the complete list, see the AWS/SMSVoice namespace in the CloudWatch
console.
Note
AWS End User Messaging uses an AWS Identity and Access Management (IAM) service-linked role to publish metrics to CloudWatch. The service creates this role for you the first time you perform an action that publishes metrics, so in most cases you do not need to create it yourself.
| Metric | Description |
|---|---|
NumberOfTextMessagePartsSent | The number of SMS message parts sent. |
NumberOfTextMessagePartsDelivered | The number of SMS message parts confirmed delivered. |
NumberOfMessagesReceived | The number of inbound (two-way) messages received. |
TextMessageMonthlySpend | The month-to-date spend on SMS messages, in US Dollars. |
TextMessagesBlockedByProtect | The number of SMS messages blocked by a protect configuration. |
| Messages expecting feedback | The number of messages sent with message feedback enabled that are awaiting an outcome. For more information, see Message feedback. |
Note
For some metrics, the result might be approximate due to the distributed nature of the service. In most cases, the count should be close to the actual number of messages processed.
Filter metrics by origination identity type
Several metrics in the AWS/SMSVoice namespace support the
OriginationIdentityType dimension, which lets you filter and group a metric by the
type of origination identity that sent the message. For SMS this applies to the text message part metrics (NumberOfTextMessagePartsSent and NumberOfTextMessagePartsDelivered) and to TextMessagesBlockedByProtect.
Use this dimension to compare sending and delivery across the identity types you use, for example to see how many parts were sent through a phone pool versus a sender ID. The dimension takes the following values.
| Value | Description |
|---|---|
PHONE_NUMBER |
Messages sent using a phone number (long code, short code, or toll-free number). |
SENDER_ID |
Messages sent using a sender ID. |
RCS_AGENT |
Messages sent using an AWS RCS Agent. |
POOL |
Messages sent using a phone pool. When you send through a pool, AWS End User Messaging selects the appropriate origination identity automatically. |
With CloudWatch, you can also create alarms that trigger based on metric thresholds. For example,
you can create an alarm for the NumberOfTextMessagePartsSent metric so that if more
than 1,000 text message parts are sent in one hour, an email notification is sent to an Amazon SNS
topic. For more information, see Using
Amazon CloudWatch alarms in the Amazon CloudWatch User Guide.
Send events to a destination with a configuration set
AWS End User Messaging emits an event for each message as it moves through sending and delivery. You route these events to a destination by creating a configuration set, adding one or more event destinations to it, and then specifying that configuration set when you send. The supported event destinations are Amazon CloudWatch, Amazon Data Firehose, and Amazon SNS.
To route events, create a configuration set, add one or more event destinations to it, and then specify that configuration set when you send. Both steps are shown in each tab.
When you add a destination, you choose which events to send to it. You can send all SMS, MMS, and voice events, or select specific event types, such as only delivered, successful, or failed events. For the complete list of event types and what each one means, see Event types for SMS, MMS, and voice. For the required IAM roles for each destination type, see Event destinations in AWS End User Messaging.
Send events to a destination with Amazon EventBridge
Unlike the other destinations, you do not add Amazon EventBridge to a configuration set. AWS End User Messaging sends events to Amazon EventBridge automatically, on your account's default event bus. To act on them, write Amazon EventBridge rules on the default bus that match the event type and route to a target such as Lambda, Amazon SNS, or Firehose. AWS End User Messaging sends the following events to Amazon EventBridge.
Event (detail-type) | Description |
|---|---|
| Text Message Delivery Status Updated | The delivery status of an SMS message changed. |
| Media Message Delivery Status Updated | The delivery status of an MMS message changed. |
| Voice Message Delivery Status Updated | The delivery status of a voice message changed. |
| Registration Status Change | The status of a registration, such as a phone number or sender ID registration, changed. |
To act on these events, create an Amazon EventBridge rule on the default bus that matches the
source aws.sms-voice and the detail-type you want, and set a target such
as Lambda, Amazon SNS, or Firehose.
For the full field reference and an example record for every event type, see Messaging Events.
Message feedback
Delivery metrics and events tell you a message was delivered, but not whether it achieved its purpose, such as whether the recipient entered the one-time passcode you sent or completed the action the message asked for. Message feedback closes that loop: after you send, you report the final outcome, and AWS End User Messaging uses that signal to improve how it routes your traffic.
You can enable message feedback in two ways:
Per message, at send time. Add
--message-feedback-enabledto an individual send request to turn it on for that message only.For every message, on a configuration set. Turn the setting on in a configuration set so that every message you send with that configuration set has feedback enabled.
After you enable it, report the outcome once you know it. The following tabs show the configuration set setting in the console and the per-send flag in the AWS CLI.
If you do not update the record within one hour it is automatically set to FAILED,
and the CloudWatch feedback metrics update only after the record is set to RECEIVED or
FAILED. For the full setup and outcome values, see Message feedback.
Logging API calls with CloudTrail
AWS CloudTrail captures API calls and related events made by or on behalf of your AWS account and delivers the log files to an Amazon S3 bucket that you specify. You can identify which users and accounts called AWS End User Messaging, the source IP address from which the calls were made, and when the calls occurred. For more information, see the AWS CloudTrail User Guide.