Instrument Anthropic SDK
Recipe — instrument the Anthropic SDK. Pointer to the canonical SDK samples.
Last updated
Was this helpful?
Recipe — instrument the Anthropic SDK. Pointer to the canonical SDK samples.
Canonical sample: samples/integrations/anthropic_traced.py — captures multi-turn Claude conversations via manual trace upload.
For zero-code auto-instrumentation, the Anthropic provider adapter (layerlens.instrument) is the preferred path:
pip install 'layerlens[providers-anthropic]'The adapter emits model.invoke, cost.record, and tool.call events for every Anthropic Messages API call (including streaming with single consolidated event on stream completion). Cache metadata included.
Last updated
Was this helpful?
Was this helpful?