

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

# 使用 CloudWatch 指標監控 Amazon Bedrock 防護機制
<a name="monitoring-guardrails-cw-metrics"></a>

下表說明 Amazon Bedrock 防護機制提供的執行時期指標，您可以使用 Amazon CloudWatch 指標進行監控。

**執行時期指標**


| 指標名稱 | 單位 | 說明 | 
| --- | --- | --- | 
| 調用 | SampleCount | 向 ApplyGuardrail API 操作提出的請求數。 | 
| InvocationLatency | 毫秒 | 從傳送請求到收到最後一個字符的時間。 | 
| InvocationClientErrors | SampleCount | 導致用戶端錯誤的調用數量。 | 
| InvocationServerErrors | SampleCount | 導致 AWS 伺服器端錯誤的調用次數 | 
| InvocationThrottles | SampleCount | 系統限流的調用數量。限流的請求不會計為調用或錯誤。 | 
| TextUnitCount | SampleCount | 防護機制政策耗用的文字單位數量 | 
| InvocationsIntervened | SampleCount | 防護機制介入的調用數量 | 
| FindingCounts | SampleCount | InvokeAutomatedReasoningCheck 中每種調查結果類型的計數 | 
| TotalFindings | SampleCount | 計算為每個 InvokeAutomatedReasoningCheck 請求產生的調查結果數量 | 
| 調用 (AutomatedReasoning) | SampleCount | InvokeAutomatedReasoningCheck 的請求數量 | 
| 延遲 | 毫秒 | 使用自動推理政策的驗證延遲 | 

您可以根據下表在 CloudWatch 主控台中檢視防護機制維度：

**維度**


| 維度名稱 | 維度值 | 適用於下列指標 | 
| --- | --- | --- | 
| 作業 | ApplyGuardrail |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 
| GuardrailContentSource |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 
| GuardrailPolicyType |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 
| GuardrailArn、GuardrailVersion |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 
| FindingType \+ PolicyArn \+ PolicyVersion | FindingType \+ PolicyArn \+ PolicyVersion |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 
| FindingType \+ GuardrailArn \+ GuardrailVersion | FindingType \+ GuardrailArn \+ GuardrailVersion |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 
| PolicyArn \+ PolicyVersion | PolicyArn \+ PolicyVersion |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 
| GuardrailArn \+ GuardrailVersion | GuardrailArn \+ GuardrailVersion |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/bedrock/latest/userguide/monitoring-guardrails-cw-metrics.html)  | 

**取得防護機制的 CloudWatch 指標**

您可以使用 AWS 管理主控台、 CLI 或 CloudWatch API AWS 取得護欄的指標。您可以透過其中一個 AWS 軟體開發套件 (SDKs) 或 CloudWatch API 工具來使用 CloudWatch API。

CloudWatch 中防護機制的命名空間為 `AWS/Bedrock/Guardrails`。

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

**在 CloudWatch 主控台中檢視防護機制指標**

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

1. 選擇 `AWS/Bedrock/Guardrails` 命名空間。