Amazon Bedrock Tracing
Instrument LLM calls to AWS Bedrock via the boto3 client using OpenInference and view traces 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.
Launch Arize
To get started, sign up for a free Arize account and get your Space ID and API Key.
Install
Setup
Connect to Arize using the register function.
After instrumentation, initialize your boto3
client. All clients created after instrumentation will send traces on all calls to invoke_model
.
Run Bedrock
From here you can run Bedrock as normal. The Arize example includes both Converse API and Invoke Model API. We'll show the Invoke Model API here.
Observe
Now that you have tracing setup, all calls to invoke_model
(or converse
if using that API) will be streamed to your Arize account for observability and evaluation.
Resources
Last updated
Was this helpful?