This skill helps you monitor Vercel deployments, inspect logs, and identify issues to improve observability and reliability.
npx playbooks add skill sgcarstrends/sgcarstrends --skill monitoring
Monitor Vercel deployments, check logs, and track errors.
# View recent logs
vercel logs <deployment-url>
# Stream logs in real-time
vercel logs <deployment-url> --follow
# Filter by status
vercel logs <deployment-url> --status error
Monitor in Vercel Dashboard → Analytics:
Already integrated in the app:
// apps/web/src/app/layout.tsx
import { Analytics } from "@vercel/analytics/next";
import { SpeedInsights } from "@vercel/speed-insights/next";
const RootLayout = ({ children }) => (
<html>
<body>
{children}
<Analytics />
<SpeedInsights />
</body>
</html>
);
The codebase uses standard console.log/error/warn for logging:
// Workflow logging pattern
console.log("[WORKFLOW] Posts cache invalidated");
console.log("[COE]", coeResult);
// Error logging pattern
console.error("Error getting post view count:", error);
console.error("Download failed:", { url, status });
Log Prefixes Used:
[WORKFLOW] - Workflow execution events[COE] - COE data processing[CARS] - Car data processingThe app has a health check endpoint at /api/health:
// apps/web/src/app/api/health/route.ts
export const GET = () => {
return NextResponse.json(
{ status: "ok", timestamp: new Date().toISOString() },
{
status: 200,
headers: {
"Cache-Control": "public, s-maxage=60, stale-while-revalidate=300",
},
},
);
};
Test health endpoint:
curl -f https://motormetrics.app/api/health || echo "Web unhealthy"
Workflows use Vercel WDK's built-in error handling:
// apps/web/src/workflows/cars/index.ts
import { FatalError, RetryableError } from "workflow";
// Retryable errors (will be retried automatically)
if (message.includes("429")) {
throw new RetryableError("AI rate limited", { retryAfter: "1m" });
}
// Fatal errors (will not be retried)
if (message.includes("401") || message.includes("403")) {
throw new FatalError("AI authentication failed");
}
Error Types:
RetryableError - Temporary failures (rate limits, network issues)FatalError - Permanent failures (auth errors, invalid config)# Get deployment URL
vercel ls
# Check logs
vercel logs <url> --follow
curl -v https://motormetrics.app/api/health
Vercel Dashboard → Project → Settings → Functions
| Issue | Investigation | Solution |
|-------|--------------|----------|
| High latency | Check Vercel Analytics, slow queries | Optimize queries, add caching |
| Build failures | Check build logs | Fix build errors, update dependencies |
| Function timeout | Check function logs | Optimize code, increase timeout |
| Cold starts | Check function invocations | Consider edge functions |
| Workflow failures | Check Vercel logs for workflow ID | Review error type, check retries |
// API route config
export const config = {
maxDuration: 60, // seconds (Pro plan allows up to 60s)
};
Workflows are triggered by Vercel Cron:
// apps/web/vercel.json
{
"crons": [
{ "path": "/api/workflows/cars", "schedule": "0 10 * * *" },
{ "path": "/api/workflows/coe", "schedule": "0 10 * * *" },
{ "path": "/api/workflows/deregistrations", "schedule": "0 10 * * *" }
]
}
Monitor cron executions:
[CONTEXT] prefix for easy filteringWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.