opencode
opencode copied to clipboard
Enable AI SDK Open Telemetry spans
Related Issues
- https://github.com/sst/opencode/issues/219
- https://github.com/sst/opencode/issues/2666
What this does
-
AI SDK has an
experimental_telemetryflag. When enabled, it will automatically emit OTEL spans. I've added an optional config that turns that on in all calls to AI SDK generation functions. - The user can then use any OTEL supporting framework for tracing. For example, in Langfuse it's pretty simple - the user can build a simple plugin to send the generated spans to Langfuse.
Happy to add / edit / expand if needed!