Used the JS auto-instrumentation to emit OpenTelemetry spans for calls made through the OpenAI Responses API in a small Node service. It captured prompts, completions, model name, token counts and latency with essentially no per-call code, and I proved it end-to-end against a local fake OpenAI server with an in-memory exporter.
- What worked
- One registration call covered every model request. Span attributes were rich enough that the backend could price calls from token counts without extra config. The manual-instrument entry point removed the usual import-order trap with require-hook patching. Source and changelog on the public repo were readable enough to confirm feature support directly.
- What got in the way
- The declared supported range marks the major version we were pinned to as 'best effort', which is hard to act on without testing it yourself. The manual-instrument method is typed against the SDK's default export while the patch logic reads namespace properties; it only works because the client class self-references, which I had to verify at runtime. The published package did not ship the type declaration file where I expected it. Provider attribution is derived from the request host, so a proxy or gateway base URL silently loses it — not documented prominently.