Monitor Amazon Bedrock with Amazon CloudWatch - Amazon Bedrock

Monitor Amazon Bedrock with Amazon CloudWatch

You can monitor Amazon Bedrock using Amazon CloudWatch, which collects raw data and processes it into readable, near real-time metrics. You can graph the metrics using the CloudWatch console. You can also set alarms that watch for certain thresholds, and send notifications or take actions when values exceed those thresholds.

For more information, see What is Amazon CloudWatch in the Amazon CloudWatch User Guide.

Runtime metrics

The following table describes runtime metrics provided by Amazon Bedrock.

Metric name Unit Description
Invocations SampleCount Number of requests to the InvokeModel or InvokeModelWithResponseStream API operations.

InvocationLatency

MilliSeconds

Latency of the invocations.

InvocationClientErrors

SampleCount

Number of invocations that result in client-side errors.

InvocationServerErrors

SampleCount

Number of invocations that result in AWS server-side errors.

InvocationThrottles

SampleCount

Number of invocations that the system throttled.

InputTokenCount

SampleCount

Number of tokens of text input.

LegacyModelInvocations SampleCount Number of invocations using Legacy models

OutputTokenCount

SampleCount

Number of tokens of text output.

OutputImageCount

SampleCount

Number of output images.

Logging CloudWatch metrics

For each delivery success or failure attempt, the following Amazon CloudWatch metrics are emitted under the namespace AWS/Bedrock, and Across all model IDs dimension:

  • ModelInvocationLogsCloudWatchDeliverySuccess

  • ModelInvocationLogsCloudWatchDeliveryFailure

  • ModelInvocationLogsS3DeliverySuccess

  • ModelInvocationLogsS3DeliveryFailure

  • ModelInvocationLargeDataS3DeliverySuccess

  • ModelInvocationLargeDataS3DeliveryFailure

If logs fail to deliver due to permission misconfiguration or transient failures, the delivery is retried periodically for up to 24 hours.

Use CloudWatch metrics for Amazon Bedrock

To retrieve metrics for your Amazon Bedrock operations, you specify the following information:

  • The metric dimension. A dimension is a set of name-value pairs that you use to identify a metric. Amazon Bedrock supports the following dimensions:

    • ModelId – all metrics

    • ModelId + ImageSize + BucketedStepSize – OutputImageCount

  • The metric name, such as InvocationClientErrors.

You can get metrics for Amazon Bedrock with the AWS Management Console, the AWS CLI, or the CloudWatch API. You can use the CloudWatch API through one of the AWS Software Development Kits (SDKs) or the CloudWatch API tools.

You must have the appropriate CloudWatch permissions to monitor Amazon Bedrock with CloudWatch For more information, see Authentication and Access Control for Amazon CloudWatch in the Amazon CloudWatch User Guide.

View Amazon Bedrock metrics

View Amazon Bedrock metrics in the CloudWatch console.

To view metrics (CloudWatch console)
  1. Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. Choose Metrics, choose All Metrics, and then search for ModelId.