概念 · 基于 AIF-C01
CloudWatch generative AI observability and Bedrock metrics
Bedrock sends runtime metrics to CloudWatch on its own. Invocation logs need setup, and the dashboards read both.
本课尚未翻译,暂以英文显示。
你在AI Practitioner中已学过
- CloudWatch collects metrics, logs and alarms for AWS services.
- Bedrock reports requests, latency and token counts, and can send invocation logs to CloudWatch Logs.
- CloudWatch watches performance. CloudTrail audits API calls.
Is the model slow?
- InvocationLatency, TimeToFirstToken
Are calls rejected?
- InvocationThrottles
Is AWS failing us?
- InvocationServerErrors
Why is cost rising?
- Input and output token counts
What was sent exactly?
- Invocation logs
Who used the tokens?
- Logs Insights by caller identity
| Question | Look at |
|---|---|
| Is the model slow? | InvocationLatency, TimeToFirstToken |
| Are calls rejected? | InvocationThrottles |
| Is AWS failing us? | InvocationServerErrors |
| Why is cost rising? | Input and output token counts |
| What was sent exactly? | Invocation logs |
| Who used the tokens? | Logs Insights by caller identity |
1 / 2
Is the model slow?
- InvocationLatency, TimeToFirstToken
Are calls rejected?
- InvocationThrottles
Is AWS failing us?
- InvocationServerErrors
Why is cost rising?
- Input and output token counts
| Question | Look at |
|---|---|
| Is the model slow? | InvocationLatency, TimeToFirstToken |
| Are calls rejected? | InvocationThrottles |
| Is AWS failing us? | InvocationServerErrors |
| Why is cost rising? | Input and output token counts |
2 / 2
What was sent exactly?
- Invocation logs
Who used the tokens?
- Logs Insights by caller identity
| Question | Look at |
|---|---|
| What was sent exactly? | Invocation logs |
| Who used the tokens? | Logs Insights by caller identity |
是什么
Bedrock publishes runtime metrics in the AWS/Bedrock namespace, with no setup: Invocations, InvocationLatency, InvocationClientErrors, InvocationServerErrors, InvocationThrottles, InputTokenCount and OutputTokenCount. TimeToFirstToken covers streaming calls. Throttled requests are not counted in Invocations or the error metrics, so alarm on InvocationThrottles separately. Metrics carry a ModelId dimension, but a request that fails before the model is known has none, so read totals without it.
是什么
Model invocation logging is off by default. Turn it on per Region and send it to S3, CloudWatch Logs, or both, in the same account. Each record holds the caller identity, model, input and output text and token counts. Bodies over 100 KB, and images, go to S3 as separate objects. The logs contain users’ prompts, and text a guardrail blocked appears in plain text, so encrypt them with a KMS key and limit who can read them.
是什么
CloudWatch generative AI observability adds ready-made views. The Model Invocations dashboard shows invocations, token use, latency (average, P90, P99), errors and throttles for any Bedrock model, plus a table of invocation logs. A second view covers Amazon Bedrock AgentCore agents, and end-to-end traces work with Strands, LangChain and LangGraph. To see who spends tokens, group log fields by caller identity or tag calls with request metadata.
要记住
- Throttled calls are not in Invocations: alarm on InvocationThrottles.
- Logging is off by default: S3, CloudWatch Logs or both, same account and Region.
- Protect the logs: they contain prompts and answers.
考试中
- “Alert when Bedrock rejects requests for exceeding quota” points to a CloudWatch alarm on InvocationThrottles.
- “See the exact prompts and answers sent to a model” points to model invocation logging.
- “Track token use per model over time” points to the InputTokenCount and OutputTokenCount metrics.
- “Ready-made view of model usage, latency and errors” points to CloudWatch generative AI observability.
别和这些弄混
- Monitoring workflows for errors and anomaliesRoute failures and odd metrics from pipelines, jobs and endpoints to the people who fix them.
- Agent monitoring and AgentCore ObservabilityTraces show each reasoning step and tool call, so you can find loops, failing tools and handoffs that went wrong.
- Auditing, logging and compliance for MLCloudTrail answers who did what, Config answers whether a setting is compliant, and model documents show how a model was built.