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 @arizeai/openinference-instrumentation-bedrock-agent-runtime package.
This is the TypeScript / JavaScript guide. For the Python instrumentor, see Amazon Bedrock Agents.

Prerequisites

  • Node.js 18+
  • 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-js-tracing-example.
  2. You should see a new trace within ~30 seconds containing a bedrock.invoke_agent parent span (AGENT) wrapping per-step orchestration spans, any action-group (TOOL) or knowledge-base (RETRIEVER) spans your agent uses, and an 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.ts. Enable OpenTelemetry debug logs with export OTEL_LOG_LEVEL=debug and re-run.
  • Agent spans missing. registerInstrumentations(...) must run before the bedrock-agent-runtime client is created. Make sure instrumentation.ts is imported first in your entry point.
  • 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) and it finishes building. 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.
  • AccessDeniedException. Your IAM principal needs bedrock:InvokeAgent (different from bedrock:InvokeModel) plus model access for the underlying foundation model.
  • Only LLM spans, no agent-reasoning spans. Make sure enableTrace: true is in the InvokeAgentCommand — without it, Bedrock returns only the final answer chunks and the instrumentor has no orchestration data to build the span tree.
  • Process exits before spans flush. Always await provider.forceFlush() (or provider.shutdown()) before the process exits, otherwise trailing spans are dropped.

Resources

Amazon Bedrock Agents Documentation

OpenInference Bedrock Agent Runtime Instrumentor (JavaScript / TypeScript)

AWS SDK for JavaScript — Bedrock Agent Runtime

Amazon Bedrock Agents (Python) tracing