

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

# 使用 Amazon CloudWatch 監控 Amazon Kendra
<a name="cloudwatch-metrics"></a>

若要追蹤索引的運作狀態，請使用 Amazon CloudWatch。使用 CloudWatch，您可以取得索引的文件同步指標。您也可以設定 CloudWatch 警示，以便在一或多個指標超過您定義的閾值時收到通知。例如，您可以監控要編製索引的文件數量，或無法編製索引的文件數量。

您必須擁有適當的 CloudWatch 許可，才能使用 CloudWatch 監控 Amazon Kendra。如需詳細資訊，請參閱《[Amazon CloudWatch 使用者指南》中的 Amazon CloudWatch 的身分驗證和存取控制](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/auth-and-access-control-cw.html)。 *Amazon CloudWatch *

## 檢視 Amazon Kendra 指標
<a name="viewing-metrics"></a>

使用 CloudWatch 主控台檢視 Amazon Kendra 指標。

**若要檢視指標 (CloudWatch 主控台)**

1. 登入 AWS 管理主控台 ，並在 https：//[https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/) 開啟 CloudWatch 主控台。

1. 選擇**指標**，選擇**所有指標**，然後選擇 **Kendra**。

1. 選擇維度、選擇指標名稱，再選擇 **Add to graph (新增至圖形)**。

1. 選擇日期範圍的值。所選日期範圍的指標計數會顯示在圖形中。

## 建立 警示
<a name="cloudwatch-alarms"></a>

CloudWatch 警示會監看指定期間內的單一指標，並執行一或多個動作：傳送通知至 Amazon Simple Notification Service (Amazon SNS) 頂端或 Auto Scaling 政策。動作是根據指標在您指定的數個期間內相對於指定閾值的值。當警示變更狀態時，CloudWatch 也可以傳送 Amazon SNS 訊息給您。

CloudWatch 警示只有在狀態變更且在您指定的期間持續存在時，才會叫用動作。

**設定警示**

1. 登入 AWS 管理主控台 ，並在 https：//[https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/) 開啟 CloudWatch 主控台。

1. 選擇**警示**，然後選擇**建立警示**。

1. 選取指標。為您的索引和資料來源選擇 **Kendra** 指標。也請將時間設定為設定小時數、天數、週數或自訂數。

1. 選擇您的統計資料。例如**平均**。另請將警示觸發期間選擇為設定的分鐘數、小時數、每天次數或自訂數。

1. 選擇您的觸發警示閾值 (無論是使用靜態值還是頻帶)，以及符合閾值的條件。

1. 選擇觸發的警示狀態，無論指標是否必須超出設定的閾值，還是處於另一個狀態。選取要傳送警示通知的對象/電子郵件。

1. 如果您對警示感到滿意，請選擇**建立警示**。

**注意**  
您必須提供 CloudWatch 警示的名稱。

## 索引同步任務的 CloudWatch 指標
<a name="cloudwatch-metric-sync-jobs"></a>

下表說明資料來源同步任務的 Amazon Kendra 指標。

如果您使用 API 或 CLI，除了`MetricName`使用 [GetMetricStatistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html) API 時您選擇的 之外，還必須指定 `Namespace`為 'AWS/Kendra'。


| 指標 | Description | 
| --- | --- | 
| DocumentsCrawled | 同步任務在執行期間掃描或探索的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForIndexing | 同步任務提交至索引的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForIndexingFailed | 索引失敗的文件數量。如需詳細資訊，請檢查同步任務的 CloudWatch 日誌內容。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForDeletion | 同步任務要求從索引中移除的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForDeletionFailed | 無法刪除的文件數量。如需詳細資訊，請檢查同步任務的 CloudWatch 日誌內容。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 

## Amazon Kendra 資料來源的指標
<a name="cloudwatch-metrics-data-source"></a>

下表說明資料來源同步任務的 Amazon Kendra 指標。標示星號 (\$1) 的指標僅用於 Amazon S3 資料來源。

如果您使用 API 或 CLI，除了`MetricName`使用 [GetMetricStatistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html) API 時您選擇的 之外，還必須指定 `Namespace`為 'AWS/Kendra'。


| 指標 | Description | 
| --- | --- | 
| DocumentsSkippedNoChange \$1 | 已檢查且發現沒有變更的文件數量，因此未提交索引。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSkippedInvalidMetadata \$1 | 因為相關聯的中繼資料檔案發生問題而略過的文件數量。如需詳細資訊，請檢查 CloudWatch 日誌的內容，了解同步執行。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsCrawled | 已檢查的文件檔案數目。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForDeletion | 從資料來源刪除並提交刪除的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForDeletionFailed | 從資料來源刪除失敗的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForIndexing | 已檢查並提交以供索引的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsSubmittedForIndexingFailed | 為 idexing 提交且無法編製索引的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 

## 索引文件的指標
<a name="cloudwatch-metrics-id"></a>

下表說明索引文件的 Amazon Kendra 指標。對於使用 [BatchPutDocument](https://docs.aws.amazon.com/kendra/latest/APIReference/API_BatchPutDocument.html) 操作編製索引的文件，僅支援 `IndexId`維度。

如果您使用 API 或 CLI，除了`MetricName`使用 [GetMetricStatistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html) API 時您選擇的 之外，還必須指定 `Namespace`為 'AWS/Kendra'。


| 指標 | Description | 
| --- | --- | 
| DocumentsIndexed | 編製索引的文件數量。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| DocumentsFailedToIndex | 無法編製索引的文件數量。如需詳細資訊，請檢查 CloudWatch 日誌的內容。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 
| IndexQueryCount | 每分鐘索引查詢次數。 維度： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/kendra/latest/dg/cloudwatch-metrics.html)單位：計數 | 