

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

# 在 API Gateway 中監控 REST API
<a name="rest-api-monitor"></a>

在本節中，您可以了解如何使用 CloudWatch 指標、CloudWatch Logs、Firehose 和 AWS X-Ray 監控您的 API。藉由結合 CloudWatch 執行日誌和 CloudWatch 指標，您可以記錄錯誤和執行追蹤，並監控 API 的效能。您可能還想要記錄對 Firehose 的 API 呼叫。您也可以使用 AWS X-Ray，透過組成 API 的下游服務來追蹤呼叫。

**注意**  
在下列情況下，API Gateway 可能無法產生日誌和指標：  
413 請求實體過大錯誤
431 請求標頭欄位太大錯誤
過多的 429 請求過多錯誤
400 系列錯誤，來自傳送至沒有 API 映射自訂網域的要求
由於內部失敗造成的 500 系列錯誤
測試 REST API 方法時，API Gateway 不會產生日誌和指標。系統會模擬 CloudWatch 實體。如需更多詳細資訊，請參閱 [使用 API Gateway 主控台來測試 REST API 方法](how-to-test-method.md)。

**Topics**
+ [使用 Amazon CloudWatch 指標監控 REST API 執行](monitoring-cloudwatch.md)
+ [在 API Gateway 中設定 REST API 的 CloudWatch 記錄功能](set-up-logging.md)
+ [在 API Gateway 中記錄對 Amazon Data Firehose 的 REST API 呼叫](apigateway-logging-to-kinesis.md)
+ [API Gateway 存取記錄的變數](api-gateway-variables-for-access-logging.md)
+ [在 API Gateway 中使用 X-Ray 追蹤使用者對 REST API 的請求](apigateway-xray.md)