Lesson 3 of 3 Monitoring Serverless and AI Workloads

Monitoring Amazon Bedrock Workloads

This lesson explains what Amazon Bedrock exposes for operating generative AI applications, metrics, logs, quotas and alarms, since the SOA-C03 guide includes AI workloads in the monitoring skill.

Learning outcomes

After completing this lesson, you will be able to:

  • Interpret Bedrock metrics in CloudWatch.
  • Enable model invocation logging.
  • Handle Bedrock quotas and throttling.

Bedrock metrics in CloudWatch

Amazon Bedrock publishes runtime metrics in the AWS/Bedrock namespace, dimensioned by ModelId. Invocations counts successful requests; InvocationLatency measures response time; InvocationClientErrors and InvocationServerErrors count failures; InvocationThrottles counts requests rejected because a quota was exceeded; and InputTokenCount and OutputTokenCount measure usage, which drives cost. Guardrails, agents and knowledge bases publish their own metrics, such as guardrail interventions.

Match the pairs

Bedrock metrics

Exam skills 1.1.1

Match each question about a Bedrock workload with the metric that answers it.

Log in to try this activity Interactive activities are free with an account.

Model invocation logging and tracing

Model invocation logging is disabled by default. When enabled in the Bedrock settings for a Region, it records request and response data, including prompts, completions, token counts and metadata, to CloudWatch Logs, S3 or both. Large payloads go to S3. The logging role must be able to write to the destination, and because prompts can contain sensitive data, the log group should be encrypted with KMS, protected with a data protection policy and given a retention period. CloudTrail records Bedrock management API calls, and invocation API calls can be captured as data events.

CloudWatch also provides a generative AI observability view that brings together model metrics, invocation logs and OpenTelemetry traces of agent workflows, so operators can see which step of an agent's work was slow or failed.

The following diagram shows where invocation logs go and how they are protected.

Model invocation logging for Amazon Bedrock. It is off by default; when enabled for a Region, prompts, completions, token counts and metadata go to CloudWatch Logs, to S3, or both, with large payloads in S3. Because prompts can hold sensitive data, the log group is encrypted with KMS, given a data protection policy and a retention period. CloudTrail records the API calls.
Logging is configured per Region, so each Region the application uses needs it enabled.

Quotas and throttling

Bedrock enforces per-model quotas on requests per minute and tokens per minute in each Region. When an application exceeds them, calls fail with ThrottlingException and InvocationThrottles rises. Remedies, from least to most effort, are client retries with exponential backoff and jitter, cross-Region inference profiles that spread requests over several Regions, requesting a quota increase, and buying provisioned throughput for a guaranteed rate. The following table summarises the Bedrock signals an operator should watch.

SignalSourceAction
InvocationThrottles risingCloudWatch metricBackoff, cross-Region inference, quota increase or provisioned throughput
Output tokens per request increasingOutputTokenCountReview prompts and maximum token settings; cost alarm
InvocationLatency p99 increasingCloudWatch metricCheck model choice, payload size and agent steps
Unexpected content in responsesInvocation logs, guardrail metricsAdjust Bedrock Guardrails
Select all that apply

Responding to throttling

Exam skills 1.1.1 · 1.2.1

Identify appropriate responses to sustained Bedrock throttling.

Log in to try this activity Interactive activities are free with an account.
Worked example

Alerting on throttling and spend

A support chatbot calls a Bedrock model. During a product launch users receive errors. The operator finds InvocationThrottles spiking in CloudWatch and creates an alarm on its Sum over 1 minute greater than 0 for 3 of 5 datapoints, notifying the on-call topic. The application is changed to use a cross-Region inference profile, and a second alarm on the hourly Sum of OutputTokenCount warns when usage is running above the budgeted rate. Model invocation logging to an encrypted log group with 30-day retention allows the team to review problematic conversations.

Check yourself

Why should invocation logs have encryption and a retention period?

Show answer

They can contain prompts and responses, which may hold sensitive data.

Exam Tips

Remember for the exam

  • Bedrock metrics live in AWS/Bedrock: Invocations, InvocationLatency, InvocationThrottles, token counts.
  • Model invocation logging is off by default; enable it to capture prompts and responses.
  • Encrypt and set retention on invocation logs because they can contain sensitive data.
  • ThrottlingException: retry with backoff, use cross-Region inference, raise quotas or buy provisioned throughput.