observability

Configure Vercel logging, Drains, Web Analytics, and Speed Insights for application monitoring.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill observability-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability
Source: https://github.com/AarnavBaddam/skills/tree/main/observability
Command: npx skills add https://github.com/AarnavBaddam/skills --skill observability-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @vercel/analytics, @vercel/speed-insights, @vercel/functions.

What problem does it solve? Debugging slow, stuck, or failing Vercel deployments is hard without structured logs, traces, and real-user metrics. This Skill provides expert guidance for instrumenting applications with Vercel's observability stack so errors and performance issues can be detected and diagnosed quickly. ## Core Features & Use Cases - Structured Logging & Runtime Logs: Add JSON-formatted logging baselines to API routes and server actions, then query logs via the Vercel CLI, REST API, or MCP tools. - Drains Configuration: Forward logs, traces, Speed Insights, and Web Analytics data to external platforms like Datadog and Honeycomb via JSON, NDJSON, Syslog, or OTLP endpoints, with HMAC signature verification. - Web Analytics & Speed Insights: Set up privacy-friendly pageview tracking, custom events, and Core Web Vitals monitoring with @vercel/analytics and @vercel/speed-insights. - Use Case: After a production deploy, run a post-deploy error scan with vercel logs <url> --level error --since 1h and correlate failures with drain payloads to pinpoint the root cause. ## Quick Start Ask the assistant to add structured logging and Vercel Analytics to your Next.js app and verify the setup with a post-deploy error scan.

Frequently Asked Questions about observability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add structured logging to Vercel serverless functions?

Add JSON-formatted console.log and console.error calls at the start and end of each API route, including fields like level, message, route, requestId from the x-vercel-id header, and duration in milliseconds. These logs appear in Vercel's runtime log viewer and can be queried via CLI or REST API.

How do I set up Vercel log drains to Datadog?

Create a drain via the Vercel Dashboard settings page or the /v1/drains REST API endpoint, pointing to Datadog's intake URL with your DD-API-KEY header. Alternatively, run vercel integration add datadog to auto-configure the drain through the Marketplace.

Does Vercel Drains work on the Hobby plan?

No, Drains require a Pro or Enterprise plan. On Hobby, use the Vercel CLI vercel logs command with --follow, --level, and --since flags, the Dashboard logs tab, or the runtime logs REST API endpoint instead.

How do I verify Vercel drain webhook signatures?

Compute an HMAC-SHA1 hash of the raw request body using your drain secret and compare it to the x-vercel-signature header using timingSafeEqual. Always verify against the raw body, since re-serializing parsed JSON can break the signature match.

What is the difference between Vercel Web Analytics and Speed Insights?

Web Analytics tracks pageviews, referrers, and custom business events using first-party, privacy-friendly collection. Speed Insights measures real-user Core Web Vitals like LCP, INP, and CLS per route for performance monitoring.

Why is my Vercel function timing out or hanging?

First check runtime logs with vercel logs <url> --level error to find where execution stalls, and verify a structured logging baseline exists to measure duration. Timeout errors may require increasing maxDuration in your function configuration.