VE

vercel-observability

Implement comprehensive monitoring, analytics, and tracing for Vercel applications to track performance and runtime logs.

Install

mkdir -p .claude/skills/vercel-observability && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4223" && unzip -o skill.zip -d .claude/skills/vercel-observability && rm skill.zip

Installs to .claude/skills/vercel-observability

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Set up Vercel observability with runtime logs, analytics, log drains,
69 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Enable Web Analytics and Speed Insights
  • Capture runtime logs including function invocations and console output
  • Configure log drains to external providers like Datadog or Sentry
  • Instrument applications with OpenTelemetry for distributed tracing
  • Set up error tracking with Sentry

How it works

It integrates built-in Vercel analytics and log drains with external providers while providing patterns for structured JSON logging and OpenTelemetry instrumentation.

Inputs & outputs

You give it
Vercel project and observability requirements
You get back
Configured analytics, log drains, and tracing instrumentation

When to use vercel-observability

  • Enable Core Web Vitals and speed tracking
  • Configure log drains for external monitoring
  • Instrument apps with OpenTelemetry
  • Set up alerts for deployment errors

About this skill

Vercel Observability

Overview

Configure comprehensive observability for Vercel deployments using built-in analytics, runtime logs, log drains to external providers, OpenTelemetry integration, and custom instrumentation. Covers the full observability stack from function-level metrics to end-user experience monitoring.

Prerequisites

  • Vercel Pro or Enterprise plan (for log drains and extended retention)
  • External logging provider (Datadog, Axiom, Sentry) — optional
  • OpenTelemetry SDK — optional

Instructions

Step 1: Enable Vercel Analytics

In the Vercel dashboard:

  1. Go to Analytics tab
  2. Enable Web Analytics (Core Web Vitals, page views)
  3. Enable Speed Insights (real user performance data)
// For Next.js — add the analytics component
// src/app/layout.tsx
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Analytics />
        <SpeedInsights />
      </body>
    </html>
  );
}

Install: npm install @vercel/analytics @vercel/speed-insights

Step 2: Runtime Logs

# View runtime logs via CLI
vercel logs https://my-app.vercel.app --follow

# Filter by level
vercel logs https://my-app.vercel.app --level=error

# View logs via API
curl -s -H "Authorization: Bearer $VERCEL_TOKEN" \
  "https://api.vercel.com/v2/deployments/dpl_xxx/events?limit=50&direction=backward" \
  | jq '.[] | {timestamp: .created, level: .level, message: .text}'

Runtime logs include:

  • Function invocation start/end with duration
  • console.log/warn/error output from functions
  • Edge Middleware execution logs
  • HTTP request/response metadata

Step 3: Structured Logging in Functions

// lib/logger.ts — structured JSON logging
interface LogEntry {
  level: 'info' | 'warn' | 'error';
  message: string;
  requestId?: string;
  duration?: number;
  [key: string]: unknown;
}

export function log(entry: LogEntry): void {
  // Vercel captures console output as runtime logs
  const output = JSON.stringify({
    ...entry,
    timestamp: new Date().toISOString(),
    region: process.env.VERCEL_REGION,
    env: process.env.VERCEL_ENV,
  });

  switch (entry.level) {
    case 'error': console.error(output); break;
    case 'warn': console.warn(output); break;
    default: console.log(output);
  }
}

// Usage in API route:
export async function GET(request: Request) {
  const requestId = crypto.randomUUID();
  const start = Date.now();

  try {
    const data = await fetchData();
    log({ level: 'info', message: 'Fetched data', requestId, duration: Date.now() - start });
    return Response.json(data);
  } catch (error) {
    log({ level: 'error', message: 'Data fetch failed', requestId, error: String(error) });
    return Response.json({ error: 'Internal error', requestId }, { status: 500 });
  }
}

Step 4: Log Drains (External Providers)

Configure log drains to send all Vercel logs to your logging provider:

In dashboard: Settings > Log Drains > Add

Supported providers:

ProviderTypeSetup
DatadogHTTPAPI key + site URL
AxiomHTTPAPI token + dataset
SentryHTTPDSN
CustomHTTP/NDJSONAny HTTPS endpoint
Grafana LokiHTTPPush URL + auth

Log drain delivers:

  • Runtime logs: function invocations, console output
  • Build logs: build step output, warnings, errors
  • Static logs: CDN access logs (edge)
  • Firewall logs: WAF events
# Create a log drain via API
curl -X POST "https://api.vercel.com/v2/integrations/log-drains" \
  -H "Authorization: Bearer $VERCEL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-datadog-drain",
    "type": "json",
    "url": "https://http-intake.logs.datadoghq.com/api/v2/logs",
    "headers": {"DD-API-KEY": "your-datadog-api-key"},
    "sources": ["lambda", "edge", "build", "static"]
  }'

Step 5: OpenTelemetry Integration

// instrumentation.ts (Next.js 13.4+)
import { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';

export function register() {
  const sdk = new NodeSDK({
    traceExporter: new OTLPTraceExporter({
      url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
    }),
    instrumentations: [getNodeAutoInstrumentations()],
    serviceName: 'my-vercel-app',
  });
  sdk.start();
}
// next.config.js
module.exports = {
  experimental: {
    instrumentationHook: true,
  },
};

Step 6: Error Tracking with Sentry

npx @sentry/wizard@latest -i nextjs
// sentry.client.config.ts
import * as Sentry from '@sentry/nextjs';

Sentry.init({
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  environment: process.env.VERCEL_ENV,
  release: process.env.VERCEL_GIT_COMMIT_SHA,
  tracesSampleRate: process.env.VERCEL_ENV === 'production' ? 0.1 : 1.0,
});

Monitoring Dashboard Checklist

MetricSourceAlert Threshold
Error rateRuntime logs> 1% of requests
P95 function latencyVercel Analytics> 2s
Cold start frequencyRuntime logs> 20% of invocations
Build success rateBuild logsAny failure
Core Web Vitals (LCP)Speed Insights> 2.5s
Edge cache hit rateStatic logs< 80%

Output

  • Vercel Analytics and Speed Insights enabled
  • Structured JSON logging in all functions
  • Log drains configured to external provider
  • Error tracking with Sentry or equivalent
  • OpenTelemetry tracing for distributed systems

Error Handling

ErrorCauseSolution
Logs missingLog retention expired (1hr free, 30d with Plus)Enable log drains for persistence
Analytics not trackingMissing <Analytics /> componentAdd to root layout
Log drain not receivingWrong URL or auth headersTest the endpoint directly with curl
Sentry not capturing errorsDSN not set in production envAdd NEXT_PUBLIC_SENTRY_DSN to Production scope
OTEL traces missinginstrumentation.ts not loadedEnable instrumentationHook in next.config.js

Resources

Next Steps

For incident response, see vercel-incident-runbook.

Prerequisites

Vercel Pro or Enterprise planExternal logging providerOpenTelemetry SDK

Limitations

  • Log retention is limited to 1 hour on free plans
  • Requires Pro or Enterprise plan for log drains

How it compares

It centralizes the configuration of disparate observability tools like log drains, analytics, and tracing into a single workflow.

Compared to similar skills

vercel-observability side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
vercel-observability (this skill)225dCautionIntermediate
service-mesh-observability52moNo flagsAdvanced
gcloud-usage17moNo flagsIntermediate
devops-troubleshooter14moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

service-mesh-observability

wshobson

Implement comprehensive observability for service meshes including distributed tracing, metrics, and visualization. Use when setting up mesh monitoring, debugging latency issues, or implementing SLOs for service communication.

574

gcloud-usage

fcakyon

This skill should be used when user asks about "GCloud logs", "Cloud Logging queries", "Google Cloud metrics", "GCP observability", "trace analysis", or "debugging production issues on GCP".

14

devops-troubleshooter

sickn33

Expert DevOps troubleshooter specializing in rapid incident response, advanced debugging, and modern observability. Masters log analysis, distributed tracing, Kubernetes debugging, performance optimization, and root cause analysis. Handles production outages, system reliability, and preventive monitoring. Use PROACTIVELY for debugging, incident response, or system troubleshooting.

12

observability-monitoring-monitor-setup

sickn33

You are a monitoring and observability expert specializing in implementing comprehensive monitoring solutions. Set up metrics collection, distributed tracing, log aggregation, and create insightful da

12

openevidence-observability

jeremylongshore

Set up comprehensive observability for OpenEvidence integrations with metrics, traces, and alerts. Use when implementing monitoring for clinical AI operations, setting up dashboards, or configuring alerting for healthcare application health. Trigger with phrases like "openevidence monitoring", "openevidence metrics", "openevidence observability", "monitor openevidence", "openevidence alerts".

11

Logging and Monitoring for Agentic Workflows

Hack23

Comprehensive observability patterns for GitHub Agentic Workflows including structured logging, metrics collection, alerting strategies, debugging techniques, and production monitoring best practices for autonomous agent systems.

00

Search skills

Search the agent skills registry