Claude Agent SDK
Automatically instrument Claude Agent SDK for monitoring in Astro AI
Instrument a Claude Agent SDK agent so its query() calls, sub-agent steps, tool calls, and model invocations appear in the Astro AI dashboard. @astropods/adapter-claude-agent-sdk is a drop-in replacement for @anthropic-ai/claude-agent-sdk that re-exports the entire SDK surface with query() instrumented for OpenTelemetry.
The current version supports @anthropic-ai/claude-agent-sdk ^0.3.142.
Before you start
- A deployable Astro AI agent project built with the Claude Agent SDK.
- Astro AI sets
OTEL_EXPORTER_OTLP_ENDPOINTonly on deployed containers, so traces appear once the agent runs on the platform — not during local development.
Set up
Install the adapter
Add @astropods/adapter-claude-agent-sdk and remove any direct dependency on @anthropic-ai/claude-agent-sdk.
Troubleshooting
If nothing shows up:
- Confirm
OTEL_EXPORTER_OTLP_ENDPOINTis present in the deployed container. - Confirm every import of
@anthropic-ai/claude-agent-sdkin your codebase has been switched to@astropods/adapter-claude-agent-sdk. - Check the agent container logs for OpenTelemetry export errors.