Lesson 1 of 3 Monitoring GenAI Applications

Monitoring Bedrock with CloudWatch Metrics and Invocation Logging

This lesson explains the two Amazon Bedrock data sources that monitoring starts with, CloudWatch metrics that count and time every invocation and model invocation logs that record what was sent and returned, and how they relate to CloudTrail.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the CloudWatch metrics Bedrock publishes.
  • Enable and configure model invocation logging.
  • Choose between metrics, invocation logs and CloudTrail for a question.

CloudWatch metrics for Amazon Bedrock

Bedrock publishes runtime metrics to the AWS/Bedrock namespace with a ModelId dimension: Invocations, InvocationLatency, InvocationClientErrors (for example validation and access errors), InvocationServerErrors, InvocationThrottles, InputTokenCount and OutputTokenCount (and image counts for image models). Guardrails, agents and other features publish their own metrics, such as guardrail interventions. Alarms on throttles, server errors, latency percentiles and token counts are the baseline of operational monitoring.

CloudWatch generative AI observability provides curated views of model invocations and of agents (including AgentCore agents), with end-to-end traces, token usage, latency and errors, built on these metrics, invocation logs and OpenTelemetry traces.

Match the pairs

Bedrock CloudWatch metrics

Exam skills 4.3.1

Match each question with the AWS/Bedrock metric that answers it.

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

Model invocation logging

Model invocation logging is configured per account and Region and is off by default. When enabled, Bedrock delivers a record for each invocation (InvokeModel, Converse and their streaming variants) to CloudWatch Logs, Amazon S3 or both. Each record contains the timestamp, request ID, model ID, the caller's IAM identity, the operation, the full input and output bodies (text, and optionally image, embedding and video data) and token counts. Large bodies can be delivered to S3 when the CloudWatch destination is used.

aws bedrock put-model-invocation-logging-configuration --logging-config '{
  "cloudWatchConfig": {"logGroupName": "/bedrock/invocations",
                       "roleArn": "arn:aws:iam::111122223333:role/BedrockLoggingRole",
                       "largeDataDeliveryS3Config": {"bucketName": "bedrock-large-logs"}},
  "s3Config": {"bucketName": "bedrock-invocation-logs", "keyPrefix": "prod/"},
  "textDataDeliveryEnabled": true,
  "imageDataDeliveryEnabled": false,
  "embeddingDataDeliveryEnabled": false
}'

Because logs contain prompts and responses, they may contain sensitive data: the log group and bucket need KMS encryption, restricted access and retention settings, and applications may redact PII before sending prompts when logs must not hold it.

True or false

Model invocation logging

Exam skills 4.3.1

Check four claims about Amazon Bedrock model invocation logging.

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

Metrics, invocation logs and CloudTrail

Three sources of data monitor Amazon Bedrock, and each answers different questions. CloudWatch metrics answer how many requests were made, how fast they were, how many failed or were throttled and how many tokens they used. They are available in near real time and drive alarms and dashboards, but contain no details of individual requests.

Model invocation logs answer what exactly was sent to the model and what it returned, by recording full prompts and responses, which debugging, quality analysis and audit require. AWS CloudTrail answers who called which API, when and from where, including changes to configuration such as guardrails and knowledge bases, but it does not contain prompt or response content. Investigations usually combine all three. The following table summarises them.

SourceContainsUse for
CloudWatch metrics (AWS/Bedrock)Counts, latency, errors, throttles, tokens per modelAlarms, dashboards, capacity
Model invocation logsFull request and response, identity, tokensDebugging, quality analysis, audit of content
CloudTrailAPI calls, callers, configuration changesSecurity audit; who changed what
Generative AI observabilityCurated model and agent views with tracesEnd-to-end investigation

The following diagram compares the three sources.

Three sources for monitoring Amazon Bedrock. CloudWatch metrics answer how many requests ran, how fast and how many failed or were throttled. Model invocation logs record exactly what was sent and returned. CloudTrail records who called which API and configuration changes, but never prompt or response content.
Investigations usually combine all three.
Sort into groups

Metrics, invocation logs or CloudTrail?

Exam skills 4.3.1 · 3.3.4

Choose the data source that answers each monitoring question.

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

What did the model say?

A customer complains about an inappropriate response yesterday. The team can see the request in CloudTrail but not its content.

CloudTrail never records prompts or responses. Model invocation logging must be enabled (to CloudWatch Logs or S3, encrypted and with retention) so that future investigations can retrieve the exact exchange by request ID; application logs should record the request ID alongside the user's session.

Check yourself

In which CloudWatch namespace are metrics such as InvocationThrottles published?

Show answer

AWS/Bedrock.

Exam Tips

Remember for the exam

  • AWS/Bedrock metrics: Invocations, InvocationLatency, errors, InvocationThrottles, token counts.
  • Invocation logging is off by default; delivers full requests and responses to CloudWatch Logs or S3.
  • CloudTrail records API activity, not prompt content.
  • Protect invocation logs: KMS encryption, restricted access, retention.