Skip to main content ホーム クリエイター jeremylongshore tons-of-skills-marketplace vercel-observability
vercel-observability Set up Vercel observability with runtime logs, analytics, log drains, and OpenTelemetry tracing.
Use when implementing monitoring for Vercel deployments, setting up log drains,
or configuring alerting for function errors and performance.
Trigger with phrases like "vercel monitoring", "vercel metrics",
"vercel observability", "vercel logs", "vercel alerts", "vercel tracing".
インストールへ移動 Skills Marketplace コミュニティが作成したAIスキルを発見・探索
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace --skill vercel-observabilityコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
Zipをダウンロード ダウンロード中... このリポジトリの他の Skills langchain-deploy-integration Deploy a LangChain 1.0 / LangGraph 1.0 app to Cloud Run, Vercel, or LangServe correctly — with timeouts sized for chain length, cold-start mitigation, SSE anti-buffering headers, and Secret Manager over .env. Use when prepping a first production deploy, debugging a stream that hangs behind a proxy, or diagnosing p99 latency spikes. Trigger with "langchain deploy", "langchain cloud run", "langchain vercel python", "langchain langserve", or "langchain docker".
langchain-langgraph-agents Build a correct LangGraph 1.0 ReAct agent with create_react_agent — typed tools, error propagation, recursion caps, and stop conditions that actually stop. Use when writing a first tool-calling agent, migrating from AgentExecutor or initialize_agent, or diagnosing an agent that loops on vague prompts. Trigger with "langgraph agent", "create_react_agent", "langgraph tool calling", "AgentExecutor migration", or "agent loop cost".
langchain-langgraph-human-in-loop Build LangGraph 1.0 human-in-the-loop approval flows with interrupt_before /
interrupt_after and Command(resume=...) — JSON-serializable state, clean
resume semantics, and UI wiring for approval decisions. Use when adding an
approval gate before an expensive tool call, wiring a Slack/web UI for agent
approvals, or debugging a graph that crashes on interrupt.
Trigger with "langgraph human in loop", "langgraph interrupt_before",
"langgraph approval flow", "Command resume", "langgraph HITL".
name vercel-observability description Set up Vercel observability with runtime logs, analytics, log drains, and OpenTelemetry tracing.
Use when implementing monitoring for Vercel deployments, setting up log drains,
or configuring alerting for function errors and performance.
Trigger with phrases like "vercel monitoring", "vercel metrics",
"vercel observability", "vercel logs", "vercel alerts", "vercel tracing".
allowed-tools Read, Write, Edit, Bash(vercel:*), Bash(curl:*) version 1.18.0 license MIT author Jeremy Longshore <jeremy@intentsolutions.io> tags ["saas","vercel","monitoring","observability","logging"] compatibility Designed for Claude Code
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:
Go to Analytics tab
Enable Web Analytics (Core Web Vitals, page views)
Enable Speed Insights (real user performance data)
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
vercel logs https://my-app.vercel.app --follow
vercel logs https://my-app.vercel.app --level=error
curl -s -H \
\
| jq
"Authorization: Bearer $VERCEL_TOKEN "
"https://api.vercel.com/v2/deployments/dpl_xxx/events?limit=50&direction=backward"
'.[] | {timestamp: .created, level: .level, message: .text}'
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
interface LogEntry {
level : 'info' | 'warn' | 'error' ;
message : string ;
requestId ?: string ;
duration ?: number ;
[key : string ]: unknown ;
}
export function log (entry : LogEntry ): void {
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);
}
}
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
Provider Type Setup Datadog HTTP API key + site URL Axiom HTTP API token + dataset Sentry HTTP DSN Custom HTTP/NDJSON Any HTTPS endpoint Grafana Loki HTTP Push URL + auth
Runtime logs : function invocations, console output
Build logs : build step output, warnings, errors
Static logs : CDN access logs (edge)
Firewall logs : WAF events
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
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 ();
}
module .exports = {
experimental : {
instrumentationHook : true ,
},
};
Step 6: Error Tracking with Sentry npx @sentry/wizard@latest -i nextjs
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 Metric Source Alert Threshold Error rate Runtime logs > 1% of requests P95 function latency Vercel Analytics > 2s Cold start frequency Runtime logs > 20% of invocations Build success rate Build logs Any failure Core Web Vitals (LCP) Speed Insights > 2.5s Edge cache hit rate Static 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 Error Cause Solution Logs missing Log retention expired (1hr free, 30d with Plus) Enable log drains for persistence Analytics not tracking Missing <Analytics /> component Add to root layout Log drain not receiving Wrong URL or auth headers Test the endpoint directly with curl Sentry not capturing errors DSN not set in production env Add NEXT_PUBLIC_SENTRY_DSN to Production scope OTEL traces missing instrumentation.ts not loaded Enable instrumentationHook in next.config.js
Resources
Next Steps For incident response, see vercel-incident-runbook.