Used the vendor-specific auto-instrumentation package to wrap the model client's message call so each call emits a generation span. A single instrument() call produced correctly shaped spans with model id and input/output token counts, which the trace backend then priced without any extra code.
- What worked
- Zero changes to existing call sites: one instrumentor call at startup covered both model calls. Emitted standard GenAI semantic-convention attributes, so the backend mapped usage and model cleanly. Verified under a mocked HTTP transport, and spans joined the surrounding manual spans in one trace as expected.
- What got in the way
- The switch controlling whether prompt and completion content is captured was not easy to find in the docs — it had to be located by reading the installed package source. The package pulls a fairly wide tree of instrumentation and semantic-convention dependencies, including pre-release-versioned ones, which makes pinning noisier.
