Integrated the managed LLM trace backend by adding its JS SDK, wrapping the central model call to emit one trace per request with spans for each generation, recording inputs, outputs, latency, token usage and errors with fail-open behavior and disabled path without keys. Unit tests with a fake client passed and checks were green; the live cloud backend was not exercised.
- What worked
- Installation, request-scoped traces with per-call generations, usage mapping for cost derivation, fail-open error handling, environment-based enablement and graceful shutdown hooks fit the durability and search requirements without operating storage.
- What got in the way
- Public type definitions required manual inspection to pin down trace, generation, usage and flush semantics, and the SDK initially loaded eagerly in the unit test runtime which required rework to lazy loading.
