Skip to content

Usage Metric for Managed Bedrock Knowledgebase

0

According to docs one pricing dimension of AWS Managed Bedrock KnowledgeBases is Index Storage. Is there any CloudWatch metrics that gives this information? I see some data in Cost Explorer but no GB metrics in Cloudwatch or Bedrock. I would like to consume this data mostly via API.

2 Answers
2
Accepted Answer

Hello.

How about referring to the "RawDataSize" metric?
Since the total raw data size of the source data is listed, I believe it can be used to calculate the charges as well.
https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-observability.html

The total raw size of the source data stored in the knowledge base, in gigabytes. This metric is published after a data ingestion job completes.

With the AWS CLI, I believe you can retrieve this information using the CloudWatch metrics commands.

aws cloudwatch get-metric-statistics \
  --namespace AWS/Bedrock/KnowledgeBases \
  --metric-name RawDataSize \
  --dimensions Name=KnowledgeBaseId,Value=knowledge-base/ABCDEFGHIJ \
  --start-time 2026-09-14T00:00:00Z \
  --end-time 2026-09-15T00:00:00Z \
  --period 3600 \
  --statistics Maximum \
  --region us-east-1
EXPERT

answered a month ago

EXPERT

reviewed a month ago

  • I dont see this metric in CloudWatch (the whole namespace is missing actually), and also get no data via the CLI. Data is synced to KB and also retrievable. Are you sure its exposed for Knowledge base type: Managed vector store?

  • It is not enabled by default, so you need to configure it. Try setting the following IAM policy for the service role. IAM settings are required as described in the following document. https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-observability.html#:~:text=Permissions%20for%20publishing%20metrics

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": "cloudwatch:PutMetricData",
                "Resource": "*",
                "Condition": {
                    "StringEquals": {
                        "cloudwatch:namespace": "AWS/Bedrock/KnowledgeBases"
                    }
                }
            }
        ]
    }
    
0

Amazon Bedrock Knowledge Bases publishes several runtime metrics to CloudWatch under the AWS/Bedrock/KnowledgeBases namespace, including metrics for invocations, errors, throttles, and iteration counts. However, the standard CloudWatch metrics do not directly provide index storage size information in GB.

For tracking index storage usage, you would need to configure index usage logs delivery to CloudWatch Logs. These logs contain detailed information about consumed index storage, including fields like consumed_index_size, source_type, source_name, and consumed_source_doc_count. Once configured, you can query these logs programmatically using the CloudWatch Logs API or CloudWatch Logs Insights queries to extract storage metrics.

The index usage logs track consumption across knowledge bases and include both the total index size and per-source breakdowns. You can use the CloudWatch Logs API to retrieve this data programmatically, which would give you the GB-level storage information you're looking for. This approach allows you to access the data via API rather than relying solely on Cost Explorer.

To enable this, you'll need to configure INDEX_USAGE_LOGS delivery using CloudWatch Logs for your knowledge base, and ensure you have the appropriate permissions including bedrock:AllowVendedLogDeliveryForResource for the knowledge base resource.
Sources
Observability for managed knowledge bases - Amazon Bedrock
Monitor index storage usage - Amazon Quick

answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.