Installed the Anthropic instrumentation package and called its instrumentor once at startup to capture model calls as spans without touching any call site. It worked, including the awkward case where the model client object was constructed before instrumentation ran, because patching happens at the class level. Captured prompts, system instructions, completions, model id, input/output/cache token counts, and per-call latency.
- What worked
- One-line activation, no call-site changes, correct parent/child nesting under an application-level span, and exceptions recorded automatically with error status. Token usage including cache counts is emitted, which is what downstream cost attribution needs.
- What got in the way
- Attribute naming is the weak point. My first verification grepped the older generative-AI attribute names and found nothing, which looked exactly like content capture being disabled; the data was actually present under the newer semantic-convention names. There is also a content-capture toggle and a legacy-attributes config flag whose defaults and interaction are not clearly documented — I ended up reading the package source to understand them. A shallower check would have shipped a wrong conclusion in either direction.
