Skip to main content
Metrics are useful for visualizing system state at a point in time. To be notified when those metrics change in meaningful ways, use CloudWatch Alarms. An alarm monitors a metric and triggers when the metric breaches a defined threshold or condition. For example, you can create an alarm that fires when the number of errors in a five-minute window exceeds 100. Alarms can be simple static thresholds or use more advanced evaluation methods (for example, anomaly detection). When an alarm triggers, you define the action: notify an on-call team, send a developer message, or start automation to remediate the issue without human intervention. Alarms continually evaluate the chosen metric — if the threshold is not breached they keep monitoring and re-evaluating.

CloudWatch Alarm example

In the CloudWatch Management Console, go to Metrics → Alarms → Create alarm. When creating an alarm you select the metric and any dimensions (for example, the model or namespace) that you want to watch.
A presentation slide titled "Workflow: Respond With CloudWatch Metric Alarms" showing the AWS CloudWatch "Create alarm" interface. The screenshot displays metric details (InputTokenCount for a model), a graph area, and condition settings with a threshold set to 8000.
In this example:
  • Namespace: AWS Bedrock
  • Metric: InputTokenCount for the model Meta Llama 3 8B Instruct
  • Statistic: 5-minute average
  • Condition: trigger when the metric is greater than 8000
You can attach targets to an alarm (SNS, Lambda, Systems Manager Automation, EventBridge, etc.), or leave it as a standalone monitor. In production, triggered alarms commonly start automated remediation workflows; in simpler setups they notify humans.
Alarms can be as simple or sophisticated as you need. Start with a conservative static threshold to reduce noise, then refine the alarm using anomaly detection or composite alarms as patterns emerge.

Quick steps to create a CloudWatch alarm

  1. Open CloudWatch → Metrics → choose the Bedrock namespace.
  2. Select the metric and any dimensions (model, region).
  3. Click Create alarm → define the statistic (e.g., 5-minute average).
  4. Set the threshold and evaluation period (e.g., > 8000 for 5 minutes).
  5. Choose actions (SNS, Lambda, Systems Manager, or none).
  6. Review and create the alarm.

Bedrock model invocation logging vs application logging

When building Bedrock-based applications, consider two logging layers: Both layers are important: Bedrock invocation logs record exactly what the Bedrock Runtime received and returned, while your application logs add context (user ID, transaction ID, processing stage) that helps operators troubleshoot and correlate events. Bedrock Model Invocation Logging is disabled by default. When you enable it in the Bedrock settings you choose:
  • Destination: Amazon S3, CloudWatch Logs, or both
  • Data types to capture: text, images, embeddings, video
  • An IAM service role that grants Bedrock permission to write to the destination
Be careful: enabling model invocation logging will capture request inputs and model outputs. If payloads contain secrets or personal data, ensure you comply with your security and privacy policies.
Enabling Bedrock model invocation logging records the full request and model response (input and output). Ensure you have appropriate data handling, retention, and access controls in place before enabling this feature.
In the Management Console, open Bedrock → Settings, toggle Model Invocation Logging on, pick the data types to capture, and select your destination. In this example we send logs to CloudWatch Logs and create a new log group named model-invocations. We also specify an IAM role that gives Bedrock permission to write into CloudWatch Logs.
A screenshot of an Amazon Bedrock settings page titled "Workflow: Bedrock Model Invocation Logging." It shows options to enable model invocation logging, pick data types (text, image, embedding, video), and choose logging destinations (S3, CloudWatch) and a service role.

Viewing Bedrock invocation logs in CloudWatch Logs

After enabling Bedrock invocation logging to CloudWatch Logs, go to CloudWatch → Logs → Log groups. You will see a log group (for example, model-invocations) that Bedrock writes to. Log events appear as timestamped messages. Example log lines:
Click into a log event to expand the full JSON payload for that invocation. Each event includes metadata (timestamp, account, region, requestId), the model identifier, the input payload, and the model response. Example payload:
This demonstrates that Bedrock invocation logs capture the complete interaction (request and response) without requiring changes to your application code. Once you enable model invocation logging and grant the necessary IAM permissions, Bedrock will begin writing invocation logs to the destination you selected (CloudWatch Logs, S3, or both).

Best practices and operational tips

  • Minimize sensitive data in inputs if possible; redact or tokenise before sending.
  • Use application logs to add context (user IDs, transaction IDs) that are not present in model invocation logs.
  • Retention: set CloudWatch Logs retention policies to meet your compliance and cost objectives.
  • Automate: attach alarms to SNS or Lambda to shorten detection-to-remediation time.
  • Monitor token-based metrics (InputTokenCount, OutputTokenCount) to understand cost and usage patterns.

Watch Video