vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid
https://sdk.vercel.ai/docs
Other
8.49k stars 1.19k forks source link

Observability with OpenTelemetry #916

Open nirga opened 5 months ago

nirga commented 5 months ago

Feature Description

Instrument apps built with the AI SDK with OpenTelemetry so that users can connect it to any observability tool they want - Datadog, Honeycomb, Traceloop, etc. and get full traces of their LLMs.

newrelic

Use Case

Be able to debug prompts, completions as whole traces

Additional context

I'm the maintainer of OpenLLMetry where we built a set of extensions of OpenTelemetry for GenAI applications, supporting Python and Typescript.

navkuun commented 3 weeks ago

Hey @nirga currently trying to implement openLLMetry on my vercel ai sdk application, specifically I'm using vercels AI UI sdk and it doesn't seem to be logging the traces.

nirga commented 3 weeks ago

Hey @navkuun I'm curious to learn more. Are you on nextjs? Which version?

I'd try to do 2 things to debug it:

  1. Changing log level to debug: https://www.traceloop.com/docs/openllmetry/configuration#control-logging
  2. Manually instrumenting libraries: https://www.traceloop.com/docs/openllmetry/troubleshooting#3-ts-js-only-fix-known-instrumentation-issues

If you want, I'm also available on our community slack.