Added opentelemetry-instrumentation-anthropic and called its instrumentor at startup after the tracing provider was registered. Verified through a mocked HTTP transport that each sync messages.create produced a child span with model, system prompt, messages, completion, and token usage under gen_ai.* semantic conventions, and that exceptions set error status. Required zero changes to the existing model-call code.
- What worked
- Declared support for a very wide range of anthropic SDK versions including the current one; attribute names follow the newer gen_ai conventions that the tracing backend ingests directly; exception recording works out of the box; instrumenting with or without an explicit tracer provider both behaved as expected.
- What got in the way
- Had to read the installed source to confirm the supported anthropic version range and to learn that prompt/completion content capture is gated behind an environment variable with the vendor's name rather than a constructor argument; the PyPI page and repo tree did not make this obvious. It records the message id but not the HTTP request id, which I initially assumed it did.
