Integration Overview
Use this integration when your application calls Anthropic’s@anthropic-ai/sdk TypeScript package directly. Asymptote Observe uses OpenLLMetry’s Anthropic instrumentation so Anthropic model calls flow through the same exporter and Beacon-compatible attribute path as the rest of your agent telemetry.
Overview
Initialize Asymptote Observe before creating the Anthropic client when possible. The instrumentation captures supported Anthropic SDK spans without changing the way you callanthropic.messages.create().
Using Claude Agent SDK instead of the direct provider SDK? See Claude Agent SDK.
What Asymptote Captures
- Anthropic model calls emitted by the OpenLLMetry Anthropic instrumentation.
- OpenTelemetry resource attributes such as service name, SDK version,
beacon.origin=cloud, and export mode. - Beacon compatibility hints where supported by the SDK and instrumentation path.
- Errors recorded on failed spans.
Prerequisites
- Node.js 20 or newer.
@asymptote/sdkinstalled.@anthropic-ai/sdkinstalled.ASYMPTOTE_API_KEYset for Asymptote Managed hosted Observe, orOTEL_EXPORTER_OTLP_ENDPOINTset for customer-managed OTLP export. To get an Asymptote Managed API key, reach out for a demo.
Install the SDK and Anthropic client
Set Asymptote Managed and Anthropic environment variables
Getting Started
InitializeObserve before creating the Anthropic client when possible.
Trace Anthropic messages.create
Already-Loaded Clients
If your application imports or creates the Anthropic client before initialization, pass the module toinstrumentModules or patch it after initialization.
Instrument an already-loaded Anthropic module
Existing OpenTelemetry Providers
If your application already owns OpenTelemetry setup, register only Asymptote’s Anthropic instrumentation with your existing provider.Register Anthropic instrumentation on an existing provider
Troubleshooting
- Confirm
ASYMPTOTE_API_KEYorOTEL_EXPORTER_OTLP_ENDPOINTis set in the same process that runs the SDK. - Initialize
Observebefore constructing the Anthropic client when possible. - If the Anthropic module is imported before initialization, pass it through
instrumentModulesorObserve.patch(). - Call
Observe.flush()before short-lived scripts or jobs exit.
What’s Next
Claude Agent SDK
Wrap Claude Agent SDK query functions with Beacon-compatible prompt spans.
Instrumentation
Review initialization, module patching, and existing OpenTelemetry provider setup.

