

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用指标监控 Amazon Bedrock Guardrails CloudWatch
<a name="monitoring-guardrails-cw-metrics"></a>

下表描述了 Amazon Bedrock Guardrails 提供的运行时指标，您可以使用亚马逊指标对其进行监控。 CloudWatch 

**运行时指标**


| 指标名称 | 单位 | 说明 | 
| --- | --- | --- | 
| Invocations | SampleCount | 请求执行 ApplyGuardrail API 操作的次数 | 
| InvocationLatency | MilliSeconds | 从发送请求到收到最后一个令牌的时间。 | 
| InvocationClientErrors | SampleCount | 导致发生客户端错误的调用次数 | 
| InvocationServerErrors | SampleCount | 导致服务器端错误的调用次数 AWS  | 
| InvocationThrottles | SampleCount | 系统节流的调用次数。受限请求不会计入调用次数或错误数 | 
| TextUnitCount | SampleCount | 防护机制策略消耗的文本单元数量 | 
| InvocationsIntervened | SampleCount | 防护机制干预的调用次数 | 
| FindingCounts | SampleCount | 每种类型的发现都计数 InvokeAutomatedReasoningCheck | 
| TotalFindings | SampleCount | 计算为每个 InvokeAutomatedReasoningCheck 请求生成的调查结果数量 | 
| 调用 () AutomatedReasoning | SampleCount | 向发出的请求数 InvokeAutomatedReasoningCheck | 
| 延迟 | MilliSeconds | 使用自动推理策略进行的验证的延迟 | 

您可以根据下表在 CloudWatch 控制台中查看护栏尺寸：

**维度**


| 维度名称 | 维度值 | 适用于以下指标 | 
| --- | --- | --- | 
| 操作 | ApplyGuardrail |  +  Invocations <br />+  InvocationLatency <br />+  InvocationClientErrors <br />+  InvocationServerErrors <br />+  InvocationThrottles <br />+  InvocationsIntervened <br />+  TextUnitCount   | 
| GuardrailContentSource |  +  Input <br />+  Output   |  +  Invocations <br />+  InvocationLatency <br />+  InvocationClientErrors <br />+  InvocationServerErrors <br />+  InvocationThrottles <br />+  InvocationsIntervened <br />+  TextUnitCount   | 
| GuardrailPolicyType |  +  ContentPolicy <br />+  TopicPolicy <br />+  WordPolicy <br />+  SensitiveInformationPolicy <br />+  ContextualGroundingPolicy   |  +  InvocationsIntervened <br />+  TextUnitCount   | 
| GuardrailArn, GuardrailVersion |  +  护栏 ARN <br />+  防护机制版本号或草稿   |  +  Invocations <br />+  InvocationLatency <br />+  InvocationClientErrors <br />+  InvocationServerErrors <br />+  InvocationThrottles <br />+  InvocationsIntervened <br />+  TextUnitCount   | 
| FindingType \+ PolicyArn \+ PolicyVersion | FindingType \+ PolicyArn \+ PolicyVersion |  +  FindingCounts   | 
| FindingType \+ GuardrailArn \+ GuardrailVersion | FindingType \+ GuardrailArn \+ GuardrailVersion |  +  FindingCounts   | 
| PolicyArn \+ PolicyVersion | PolicyArn \+ PolicyVersion |  +  TotalFindings <br />+  Invocations <br />+  延迟   | 
| GuardrailArn \+ GuardrailVersion | GuardrailArn \+ GuardrailVersion |  +  TotalFindings   | 

**获取护栏 CloudWatch 指标**

您可以使用 AWS 管理控制台、CLI 或 AP AWS I 获取护栏指标。 CloudWatch 您可以通过其中一个 AWS 软件开发套件 (SDK) 或 CloudWatch API 工具来使用 API。 CloudWatch 

中护栏指标的命名空间是。 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 管理控制台并打开控制 CloudWatch 台，网址为 https://console.aws.amazon.com/cloudwatch/.

1. 选择 `AWS/Bedrock/Guardrails` 命名空间。