Bedrock
Instrument LLM calls to AWS Bedrock via the boto3 client using the BedrockInstrumentor
Last updated
Was this helpful?
Instrument LLM calls to AWS Bedrock via the boto3 client using the BedrockInstrumentor
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 Phoenix.
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.
Connect to your Phoenix instance using the register function.
After connecting to your Phoenix server, instrument boto3
prior to initializing a bedrock-runtime
client. All clients created after instrumentation will send traces on all calls to invoke_model
.
From here you can run Bedrock as normal
Now that you have tracing setup, all calls to invoke_model will be streamed to your running Phoenix for observability and evaluation.
Example Tracing & Eval Notebook
Sign up for Phoenix:
Sign up for an Arize Phoenix account at
Install packages:
Set your Phoenix endpoint and API Key:
Your Phoenix API key can be found on the Keys section of your .
Pull latest Phoenix image from :
For more info on using Phoenix with Docker, see .
By default, notebook instances do not have persistent storage, so your traces will disappear after the notebook is closed. See or use one of the other deployment options to retain traces.