Loading

Amazon Bedrock

Version 1.2.0 (View all)
Compatible Kibana version(s) 8.16.5 or higher
9.0.0 or higher
Supported Serverless project types
What's this?
Security
Observability
Subscription level
What's this?
Basic
Level of support
What's this?
Elastic

Amazon Bedrock offers a fully managed service that provides access to high-performing foundation models (FMs) from leading AI startups and Amazon through a unified API. You can choose from a wide variety of foundation models to find the one that best fits your specific use case. With Amazon Bedrock, you gain access to robust tools for building generative AI applications with security, privacy, and responsible AI practices. Amazon Bedrock enables you to easily experiment with and evaluate top foundation models, customize them privately with your data using methods like fine-tuning and Retrieval Augmented Generation (RAG), and develop agents that perform tasks by leveraging your enterprise systems and data sources.

The Amazon Bedrock integration enables a seamless connection of your model to Elastic to efficiently collect and monitor invocation logs and runtime metrics.

Elastic Security can leverage this data for security analytics including correlation, visualization and incident response. With invocation logging, you can collect the full request and response data, and any metadata associated with use of your account.

Important

Extra AWS charges on API requests will be generated by this integration. Check API Requests for more details.

This integration is compatible with the Amazon Bedrock ModelInvocationLog schema, version 1.0.

The Amazon Bedrock integration collects model invocation logs and runtime metrics.

Data streams:

  • invocation: Collects invocation logs, model input data, and model output data for all invocations in your AWS account used in Amazon Bedrock.
  • runtime: Collects Amazon Bedrock runtime metrics such as model invocation count, invocation latency, input token count, output token count and many more.
  • guardrails: Collects Amazon Bedrock Guardrails metrics such as guardrail invocation count, guardrail invocation latency, text unit utilization count, guardrail policy types associated with interventions and many more.

You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it. You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended, or self-manage the Elastic Stack on your own hardware.

Before using any Amazon Bedrock integration you will need:

  • AWS Credentials to connect with your AWS account.
  • AWS Permissions to make sure the user you're using to connect has permission to share the relevant data.

For more details about these requirements, check the AWS integration documentation.

  • Elastic Agent must be installed. For detailed guidance, follow these instructions.
  • You can install only one Elastic Agent per host.
  • Elastic Agent is required to stream data from the S3 bucket and ship the data to Elastic, where the events will then be processed through the integration's ingest pipelines.

To use the Amazon Bedrock model invocation logs, the logging model invocation logging must be enabled and be sent to a log store destination, either S3 or CloudWatch. For more details, check the Amazon Bedrock User Guide.

  1. Set up an Amazon S3 or CloudWatch Logs destination.
  2. Enable logging. You can do it either through the Amazon Bedrock console or the Amazon Bedrock API.

When log collection from an S3 bucket is enabled, you can access logs from S3 objects referenced by S3 notification events received through an SQS queue or by directly polling the list of S3 objects within the bucket.

The use of SQS notification is preferred: polling list of S3 objects is expensive in terms of performance and costs and should be used only when no SQS notification can be attached to the S3 buckets. This input integration also supports S3 notification from SNS to SQS.

To enable the SQS notification method, set the queue_url configuration value. To enable the S3 bucket list polling method, configure both the bucket_arn and number_of_workers values. Note that queue_url and bucket_arn cannot be set simultaneously, and at least one of these values must be specified.

When CloudWatch log collection is enabled, you can retrieve logs from all log streams within a specified log group. The filterLogEvents AWS API is used to list log events from the specified log group.

Amazon Bedrock runtime metrics include Invocations, InvocationLatency, InvocationClientErrors, InvocationServerErrors, OutputTokenCount, OutputImageCount, InvocationThrottles. These metrics can be used for various use cases including:

  • Comparing model latency
  • Measuring input and output token counts
  • Detecting the number of invocations that the system throttled

Amazon Bedrock guardrail metrics include Invocations, InvocationLatency, InvocationClientErrors, InvocationServerErrors, InvocationThrottles, TextUnitCount, and InvocationsIntervened. These metrics enable several use cases, such as:

  • Monitoring the latency of guardrail invocations
  • Tracking the number of text units consumed by guardrail policies
  • Detecting invocations where guardrails intervened