opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Enable AI SDK Open Telemetry spans

Open noamzbr opened this issue 1 month ago • 0 comments

Related Issues

  • https://github.com/sst/opencode/issues/219
  • https://github.com/sst/opencode/issues/2666

What this does

  • AI SDK has an experimental_telemetry flag. 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!

noamzbr avatar Dec 02 '25 10:12 noamzbr