dd-trace-js icon indicating copy to clipboard operation
dd-trace-js copied to clipboard

[FEATURE]: LLMObs - Instrumentation for `ai-sdk`

Open ianwoodfill opened this issue 9 months ago • 2 comments

Package Name

ai

Package Version(s)

4.1.50

Describe the feature you'd like

In the js/ts ecosystem, Vercels ai-sdk is quickly becoming the go-to LLM SDK over langchain. It's got a very good API, and even supports OTel and custom instrumentation. Would love an integration into Datadog LLMObs!

Is your feature request related to a problem?

No response

Describe alternatives you've considered

Just using OTel to send to Datadog APM.

Additional context

No response

ianwoodfill avatar Mar 13 '25 15:03 ianwoodfill

Hi @ianwoodfill! This one is definitely on our radar. I'll keep you updated here on any decisions/progress we make with regards to LLM Observability + Vercel's AI SDK!

sabrenner avatar Mar 14 '25 19:03 sabrenner

Hi @ianwoodfill,

This issue may be dated for you, but for anyone still looking for an answer I’ve put together a working example that connects the Vercel AI SDK to Datadog LLM Observability via OpenTelemetry:

Gist → https://gist.github.com/nt9142/403e78159999b8f1d0e79327e39c1989

It:

  • boots the Datadog tracer with llmobs enabled,
  • bridges the AI SDK’s experimental_telemetry hooks to OpenTelemetry spans,
  • ships prompts, responses, and model metadata straight to Datadog.

Hope this saves you some time!

nt9142 avatar May 13 '25 14:05 nt9142

hey folks! i followed up in the linked PR, but we released auto-instrumentation support for the Vercel AI SDK in [email protected] - feel free to give it a try and follow up with any issues (preferably in a separate issue, or DD support ticket) 😄

sabrenner avatar Aug 18 '25 17:08 sabrenner