Amazon Bedrock Agents
Instrument LLM calls to AWS Bedrock Agents via the boto3 client using OpenInference.
Last updated
Was this helpful?
Instrument LLM calls to AWS Bedrock Agents via the boto3 client using OpenInference.
Last updated
Was this helpful?
boto3 provides Python bindings to AWS services, including Bedrock Agents. Calls to these agents can be instrumented using OpenInference, enabling OpenTelemetry-compliant observability. Traces collected using can be viewed in Arize.
OpenInference Traces collect telemetry data about the execution of your LLM application. Consider using this instrumentation to understand how Bedrock Agents are calling their own internal action groups, knowledgebases, and models.
To get started instrumenting Bedrock Agents 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_agent
.
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 . Please use v1.34.116 or above to utilize converse.