Observing Vercel AI SDK with OpenTelemetry + SigNoz SigNoz announced a new integration with the Vercel AI SDK and OpenTelemetry to provide observability for LLM-powered applications, enabling developers to monitor latency, errors, and model behavior in production. The solution uses OpenTelemetry for standard instrumentation and SigNoz for real-time visualization and alerting, demonstrated through a product support chatbot example. Observing Vercel AI SDK with OpenTelemetry + SigNoz LLM-powered apps are growing fast, and frameworks like the Vercel AI SDK make it easy to build them. But with AI comes complexity. Latency issues, unpredictable outputs, and opaque failures can impact user experience. That’s why monitoring is essential. By using OpenTelemetry for standard instrumentation and SigNoz for observability, you can track performance, detect errors, and gain insights into your AI app’s behavior with minimal setup. What is the Vercel AI SDK? Why Monitoring Matters The Vercel AI SDK makes it easy to build LLM-powered apps with support for providers like OpenAI, Anthropic, and Hugging Face. It handles streaming, tool use, and agent flows out of the box. But while development is simple, production observability is often overlooked. LLMs can be slow, unpredictable, and error-prone, making monitoring critical. Tracking latency, errors, and model behavior helps ensure reliability and a better user experience. In this blog, we will use OpenTelemetry and SigNoz to monitor this data, helping you gain actionable insights into your app’s performance and troubleshoot issues effectively. Quick Overview: OpenTelemetry and SigNoz What is OpenTelemetry? OpenTelemetry https://signoz.io/opentelemetry/ OTel is an open-source observability framework that provides a unified standard for collecting telemetry data—traces, metrics, and logs—from across your application stack. It’s maintained by the CNCF and is supported by a wide range of tools and languages, making it a go-to choice for modern distributed systems. With OTel, developers can instrument their code once and export data to any observability backend, avoiding vendor lock-in. What is SigNoz? SigNoz https://signoz.io/ is a one-stop observability platform built on top of OpenTelemetry. It provides a rich UI to visualize traces, monitor performance metrics, and set alerts, all in real time. By combining OpenTelemetry’s standardized data collection with SigNoz’s powerful analysis and dashboards, you get a robust solution for monitoring everything from traditional web services to AI-powered applications. The Example App - A Product Support Chatbot To demonstrate how monitoring works in practice, we’ve built a simple product support chatbot using the Vercel AI SDK. The app allows users to ask questions about a product, choose from suggested starter prompts, and give feedback on the chatbot’s responses. A thumbs-up triggers the bot to suggest helpful follow-up questions to deepen the conversation. If the user gives a thumbs-down, the LLM regenerates a new response in an attempt to better address the query. The chatbot leverages streaming and LLM calls under the hood—making it a great candidate for observability. By instrumenting this app with OpenTelemetry and analyzing it in SigNoz, we can gain visibility into response times, error patterns, and user interactions. You can check out the code in the example chatbot GitHub repository https://github.com/SigNoz/vercel-ai-sdk-opentelemetry-example . Watch our demo video showcasing the chatbot's capabilities here: Work With Our Demo Chatbot If you'd like to get started quickly, you can clone our example Vercel chatbot application that already includes OpenTelemetry setup. This is a great way to explore how everything works end-to-end. git clone https://github.com/SigNoz/vercel-ai-sdk-opentelemetry-example.git cd vercel-ai-sdk-opentelemetry-example pnpm install Once you’ve cloned the example or set up your own Next.js project, follow the steps below to instrument your application and send traces to SigNoz Cloud. Instrument your Next.js application Check out our OpenTelemetry Next.js instrumentation guide https://signoz.io/docs/instrumentation/javascript/opentelemetry-nextjs/ for detailed instructions on how to set up OpenTelemetry instrumentation in your Next.js applications https://signoz.io/blog/opentelemetry-nextjs/ and view your application traces in SigNoz. This blog covers the essential steps to get started. For the complete reference guide, including self-hosted SigNoz setup, custom tracers, and dashboard import, see our Vercel AI SDK observability documentation https://signoz.io/docs/vercel-ai-sdk-observability/ . Prerequisites - Next.js app - Vercel AI SDK integrated into the app SigNoz Cloud Account https://signoz.io/teams/ - SigNoz Ingestion Key Send traces directly to SigNoz Cloud Step 1. Install OpenTelemetry packages pnpm add @vercel/otel @opentelemetry/api Step 2. Update next.config.mjs to include instrumentationHook This step is only needed when using NextJs 14 and below js / @type {import 'next' .NextConfig} / const nextConfig = { // include instrumentationHook experimental feature experimental: { instrumentationHook: true, }, }; export default nextConfig; Step 3. Create instrumentation.ts file in root project directory js import { registerOTel, OTLPHttpJsonTraceExporter } from '@vercel/otel'; // Add otel logging import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api'; diag.setLogger new DiagConsoleLogger , DiagLogLevel.ERROR ; // set diaglog level to DEBUG when debugging export function register { registerOTel { serviceName: '