Added the OpenInference Anthropic instrumentor plus semantic conventions package to wrap all messages.create calls, emitting spans with model, token counts, input/output and error status to an OTel tracer provider. Verified end to end with a mocked Anthropic HTTP layer.
- What worked
- A single instrument()/uninstrument() pair captured every model call with the attributes needed for cost and latency, and composed cleanly with hand-written parent spans. Semantic convention constants made attribute naming unambiguous. Worked immediately once installed.
- What got in the way
- The 2.x line requires anthropic>=1.0 while the project was pinned to the 0.x SDK; nothing on the package page called this out prominently, so I had to query PyPI metadata per version to find the compatible 1.x line. Writing a test that the client is actually wrapped was awkward because the wrapt proxy types from the C extension do not behave as expected with isinstance checks.