Skip to main content
Amazon Bedrock Agents are managed agents you define, prepare, and deploy on AWS. Arize AX captures every Bedrock Agent invocation — the agent’s reasoning steps, action-group (tool) calls, knowledge-base lookups, and the underlying LLM calls — via the openinference-instrumentation-bedrock package (the same instrumentor used by the Amazon Bedrock tracing guide for plain invoke_model / converse calls).
This is the Python guide. For the TypeScript / JavaScript instrumentor, see Amazon Bedrock Agents JS.

Prerequisites

  • Python 3.10+
  • An Arize AX account (sign up)
  • An AWS account with:
    • Bedrock model access enabled for the foundation model your agent uses
    • A deployed Bedrock Agent in the PREPARED state, with a callable agent alias. Create one from the Bedrock console or via the bedrock-agent (control-plane) API — see Create an agent. You’ll need the agent ID (e.g. WYHKWZQCFM) and the agent alias ID (e.g. TSTALIASID for the auto-generated draft, or a custom alias) to invoke it.

Launch Arize AX

  1. Sign in to your Arize AX account.
  2. From Space Settings, copy your Space ID and API Key. You will set them as ARIZE_SPACE_ID and ARIZE_API_KEY below.

Install

Configure credentials

Setup tracing

Run Amazon Bedrock Agents

Expected output

Verify in Arize AX

  1. Open your Arize AX space and select project amazon-bedrock-agents-tracing-example.
  2. You should see a new trace within ~30 seconds containing a bedrock_agent.invoke_agent parent span (AGENT) wrapping per-step orchestration spans, any bedrock_agent.action_group_invocation (TOOL) or bedrock_agent.knowledge_base_lookup (RETRIEVER) spans your agent uses, and a bedrock_agent.llm LLM span (with the prompt, response, and token usage attached).
  3. If no traces appear, see Troubleshooting.

Check from the skill, CLI, or SDK

Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.
Install the Arize Skills plugin and let your coding agent check for you:
Then prompt your agent:
Use the arize-trace skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.

Troubleshooting

  • No traces in Arize AX. Confirm ARIZE_SPACE_ID and ARIZE_API_KEY are set in the same shell that runs example.py. Enable OpenTelemetry debug logs with export OTEL_LOG_LEVEL=debug and re-run.
  • Bedrock Agents spans missing but other spans present. BedrockInstrumentor().instrument(...) must run before boto3.client("bedrock-agent-runtime", ...) is called. Make sure instrumentation.py is the first import in your entry point — clients created before instrumentation aren’t patched.
  • ValidationException: Agent <agent_id> is not in PREPARED state. A newly-created agent stays in NOT_PREPARED until you click Prepare in the console (or call bedrock_agent.prepare_agent(agentId=...) followed by polling until agentStatus == "PREPARED"). Agents must be re-prepared after any change to instructions, action groups, or knowledge bases.
  • ResourceNotFoundException: ... agent alias .... A “draft” agent has no callable alias by default — the auto-generated test alias TSTALIASID only works once the agent is prepared. Create an alias via the Aliases tab in the Bedrock console or bedrock_agent.create_agent_alias(agentId=..., agentAliasName=...).
  • AccessDeniedException. Your IAM principal needs bedrock:InvokeAgent (note: different permission from bedrock:InvokeModel used by the plain Bedrock tracing guide) plus model-access for the underlying foundation model.
  • Only LLM spans, no agent-reasoning spans. Make sure enableTrace=True is in the invoke_agent call — without it, Bedrock returns only the final answer chunks and the instrumentor has no orchestration data to build the span tree.

Resources

Amazon Bedrock Agents Documentation

OpenInference Bedrock Instrumentor (Python)

Amazon Bedrock Agents JS tracing

Bedrock Examples (Agents, Action Groups, Knowledge Bases)

Amazon Bedrock (plain invoke_model / converse) tracing