AWS Bedrock
Instrument LLM calls to AWS Bedrock via the boto3 client using OpenInference.
Last updated
Was this helpful?
Instrument LLM calls to AWS Bedrock via the boto3 client using OpenInference.
Last updated
Was this helpful?
boto3 provides Python bindings to AWS services, including Bedrock, which provides access to a number of foundation models. Calls to these models can be instrumented using OpenInference, enabling OpenTelemetry-compliant observability of applications built using these models. Traces collected using OpenInference can be viewed in Arize.
boto3 provides Python bindings to AWS services, including Bedrock, which provides access to a number of foundation models. Calls to these models can be instrumented using OpenInference, enabling OpenTelemetry-compliant observability of applications built using these models. Traces collected using OpenInference can be viewed in Arize.
OpenInference Traces collect telemetry data about the execution of your LLM application. Consider using this instrumentation to understand how a Bedrock-managed models are being called inside a complex system and to troubleshoot issues such as extraction and response synthesis.
To get started instrumenting Bedrock calls via boto3, we need to install two components: the OpenInference instrumentation for AWS Bedrock, and an OpenTelemetry exporter used to send these traces to Phoenix.
Instrument boto3
prior to initializing a bedrock-runtime
client. All clients created after instrumentation will send traces on all calls to invoke_model
.
You can use the following code to test whether your tracing is working.
Note: we are showing examples using both the Converse API as well as the Invoke Model API. The Converse API was introduced in botocore v1.34.116. Please use v1.34.116 or above to utilize converse.