

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 Amazon CloudWatch 監控 AWS 最終使用者簡訊簡訊
<a name="monitoring-cloudwatch"></a>

您可以使用 CloudWatch 監控 AWS 最終使用者傳訊簡訊，它會收集原始資料並將其處理為可讀且近乎即時的指標。這些統計資料會保留 15 個月，以便您存取歷史資訊，並更清楚 Web 應用程式或服務的執行效能。您也可以設定留意特定閾值的警示，當滿足這些閾值時傳送通知或採取動作。如需詳細資訊，請參閱 [Amazon CloudWatch 使用者指南](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/)。

AWS 最終使用者傳訊簡訊使用 AWS Identity and Access Management (IAM) [服務連結角色](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts)。服務連結角色是直接連結至 AWS 最終使用者簡訊簡訊的唯一 IAM 角色類型。服務連結角色由 AWS 最終使用者簡訊簡訊預先定義，並包含服務代表您呼叫其他 AWS 服務所需的所有許可。您必須為要收集的 CloudWatch 指標建立[服務連結角色](using-service-linked-roles.md#using-service-linked-roles.title)。

## AWS 最終使用者傳訊簡訊的 CloudWatch 指標
<a name="cw-metrics"></a>

下列各節列出 AWS 最終使用者傳訊 SMS 的指標和維度。

**重要**  
您必須為要收集的 CloudWatch 指標建立[服務連結角色](using-service-linked-roles.md#using-service-linked-roles.title)。

**注意**  
對於某些指標，由於服務的分散式性質，結果可能是近似值。在大多數情況下，計數應接近實際處理的訊息數量。

對於 AWS 最終使用者簡訊簡訊，您可能想要監看 **TextMessageMonthlySpend**、**MediaMessageMonthlySpend** 和 **VoiceMessageMonthlySpend**，並在大於或等於閾值時觸發警示。 AWS 最終使用者傳訊簡訊的命名空間為 `AWS/SMSVoice`。

AWS 最終使用者傳訊簡訊也會在`AWS/SMSVoice`命名空間中發佈 RCS 特定的指標，包括 `RCS.MessagesSent`、 `RCS.MessagesDelivered`和 `RCS.MessagesFallenBackToSMS`。現有指標現在包含具有 `PHONE_NUMBER`、`RCS_AGENT`、 `SENDER_ID`和 等值的維`OriginationIdentityType`度`POOL`。如需 RCS 指標和維度的完整清單，請參閱 [RCS CloudWatch 指標和監控](rcs-monitoring.md)。

**Topics**
+ [訊息支出指標](#cw-metrics-message-spend)
+ [訊息傳遞指標](#cw-metrics-message-delivery)
+ [訊息轉換指標](#cw-metrics-message-conversion)
+ [保護指標](#filter-and-monitor-messages-metrics)
+ [維度](#cw-metrics-message-dimensions)

### 訊息支出指標
<a name="cw-metrics-message-spend"></a>


**訊息支出指標**  

| 指標 | Description | 單位 |  有意義的統計資料  | 
| --- | --- | --- | --- | 
|  TextMessageMonthlySpend | 您本月已花費在傳送簡訊的金額 （美元）。 | 美元 | 上限 | 
| VoiceMessageMonthlySpend | 您本月已花費在傳送語音訊息的金額 （美元）。 | 美元 | 上限 | 
| MediaMessageMonthlySpend | 您本月已花費在傳送 MMS 訊息的金額 （美元）。 | 美元 | 上限 | 

### 訊息傳遞指標
<a name="cw-metrics-message-delivery"></a>

`AWS/SMSVoice` 命名空間包含下列訊息傳遞指標。


**訊息傳遞指標**  

| 指標 | Description | 單位 | 有意義的統計資料 | 
| --- | --- | --- | --- | 
| NumberOfTextMessagePartsSent | 傳送的文字訊息部分數量。排除被保護和服務限制封鎖的訊息，例如訊息支出限制 | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 
| **NumberOfMediaMessagePartsSent** | 傳送的媒體訊息部分數量。排除被保護和服務限制封鎖的訊息，例如訊息支出限制 | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 
| NumberOfTextMessagePartsDelivered | 交付給收件人的文字訊息部分數量。 | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 
| NumberOfMediaMessagePartsDelivered | 交付給收件人的媒體訊息組件數量。 | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 

**分段訊息的重複交付回條**  
當訊息分割為多個部分時，電信業者基礎設施可能會傳回相同訊息的多個交付確認。**NumberOfTextMessagePartsDelivered** 和 **NumberOfMediaMessagePartsDelivered** 指標會記錄每個收到的交付接收，這表示交付計數偶爾可能會超過指定訊息的傳送計數。每則訊息只會傳送一次，收件人不會收到重複項目。額外的交付事件是重複的交付回條，而不是重複的傳送。  
對帳單沒有影響。無論記錄多少交付回條，每個傳送的訊息部分都會向您收取一次費用。  
如果您的應用程式計算交付事件以進行調校，建議您對訊息 ID 進行重複資料刪除。

### 訊息意見回饋指標
<a name="cw-metrics-message-conversion"></a>

`AWS/SMSVoice` 命名空間包含下列訊息回饋指標。


**訊息意見回饋指標**  

| 指標 | Description | 單位 | 有意義的統計資料 | 
| --- | --- | --- | --- | 
| NumberOfTextMessagesExpectingFeedback | 追蹤意見回饋的文字訊息總數。<br />啟用 MessageFeedbackEnabled 的每個請求的 **NumberOfTextMessagesExpectingFeedback** 值為 1。 `SendTextMessage` MessageFeedbackEnabled  | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 
| NumberOfMediaMessagesExpectingFeedback | 追蹤意見回饋的媒體訊息總數。<br />**NumberOfMediaMessagesExpectingFeedback** 對於每個啟用 MessageFeedbackEnabled 的`SendMediaMessage`請求將具有 1 的值。 | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 
| NumberOfTextMessagesWithFeedback | 追蹤意見回饋並收到意見回饋回應的文字訊息總數。<br />**NumberOfTextMessagesWithFeedback** 每個接收意見回饋的訊息的值為 1。具有意見回饋的訊息百分比可由 決定 `100 * SUM(NumberOfTextMessagesWithFeedback) / SUM(NumberOfTextMessagesExpectingFeedback)` | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 
| NumberOfMediaMessagesWithFeedback | 追蹤意見回饋並收到意見回饋回應的媒體訊息總數。<br />**NumberOfMediaMessagesWithFeedback** 每個收到意見回饋的訊息的值為 1。具有意見回饋的訊息百分比可由 決定 `100 * SUM(NumberOfMediaMessagesWithFeedback) / SUM(NumberOfMediaMessagesExpectingFeedback)` | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 

### 保護 AWS 最終使用者傳訊簡訊中的指標
<a name="filter-and-monitor-messages-metrics"></a>

`AWS/SMSVoice` 命名空間包含下列 Protect 指標。


****  

| 指標名稱 | Description | 單位 | 有意義的統計資料 | 
| --- | --- | --- | --- | 
| TextMessagesBlockedByProtect | 由於國家/地區模式封鎖規則而封鎖的文字訊息數量。<br />如果保護封鎖訊息，則 **TextMessagesBlockedByProtect** 的值為 1，如果未封鎖訊息，則為 0。<br />Protect 封鎖的 SMS 訊息百分比可由 決定`100 * AVG(TextMessagesBlockedByProtect)`。 | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 
| MediaMessagesBlockedByProtect | 由於國家/地區模式封鎖規則而封鎖的媒體訊息數量。<br />如果保護封鎖訊息，則 **MediaMessagesBlockedByProtect** 的值為 1，如果未封鎖訊息，則為 0。<br />Protect 封鎖的 MMS 訊息百分比可由 決定`100 * AVG(MediaMessagesBlockedByProtect)`。 | 計數 |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/sms-voice/latest/userguide/monitoring-cloudwatch.html)  | 

### 維度
<a name="cw-metrics-message-dimensions"></a>

您可以使用下列維度來強化上表中列出的指標。這些維度可讓您根據簡訊和語音訊息的特定屬性來篩選和分組指標。


****  

| 維度 | 描述 | 
| --- | --- | 
| 無 | 請勿篩選 | 
| IsoCountryCode | 此維度會依 ISO 國家/地區碼篩選您請求的資料 | 
| MessageFeedbackStatus | 此維度會依訊息意見回饋狀態 RECEIVED或 篩選您請求的資料 FAILED | 
| ProtectConfigurationId | 此維度會透過保護組態來篩選您請求的資料 | 
| 【IsoCountryCode、MessageFeedbackStatus】 | 此維度會依 ISO 國家/地區代碼和訊息意見回饋狀態篩選您請求的資料 | 
| 【ProtectConfigurationId、IsoCountryCode】 | 此維度會透過保護組態和 ISO 國家/地區碼來篩選您請求的資料 | 
| OriginationIdentityType | 此維度會依起始身分類型篩選您請求的資料。值包括 PHONE\_NUMBER、RCS\_AGENT、 SENDER\_ID和 POOL。如需詳細資訊，請參閱[RCS CloudWatch 指標和監控](rcs-monitoring.md)。 | 