Installed the Anthropic instrumentor and the semantic-conventions package, called instrument() with my tracer provider, and verified in tests that each messages.create call produced a span with model name, provider, and prompt/completion token counts including cache read and write counts. It worked exactly as expected once installed.
- What worked
- One call to instrument the SDK, and the emitted attributes are precisely what a cost-tracking backend needs. Captures inputs, outputs, timing and errors without any code changes at the call site.
- What got in the way
- The current release requires the 1.x Anthropic SDK, which forced a major-version upgrade in a project pinned to 0.x. I also had to read the installed package source to confirm which attributes it sets and the instrument() signature, because the package page did not spell that out.