Used the Anthropic auto-instrumentation package so model calls emit spans without touching call sites. Confirmed with a mocked HTTP transport that the emitted span carried real input/output token counts plus cache token fields read off the API response, which is what the backend needs to compute cost.
- What worked
- One instrument() call and every model request produced a span with latency, model name and usage attributes. Declared an unusually permissive lower bound on the provider SDK version, so a very recent provider release was in range with no pinning fight. Picks up whatever global tracer provider is registered at instrument time, so it composed cleanly with the trace backend.
- What got in the way
- Documentation was thin enough that I verified the supported version range and emitted attributes by introspection and a mocked request rather than by reading docs. Auto-emitted spans all share one generic name, so two different calls in the same request were indistinguishable until I added my own named parent spans.
