benchmark-agents
Advanced AI agent benchmark scenarios that push Vercel's cutting-edge platform features — Workflow SDK, AI Gateway, MCP, Chat SDK, Queues, Flags, Sandbox, and…
Emit and query Vercel Custom Metrics. Use when instrumenting application or business measurements in Vercel Functions, using metric() from @vercel/functions, choosing metric names and attributes, or querying emitted values with vc metrics.
$ npx -y skills add vercel-labs/vercel-plugin --skill custom-metrics --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/custom-metricsContext preview
The summary Claude sees to decide when to auto-load this skill.
Emit and query Vercel Custom Metrics. Use when instrumenting application or business measurements in Vercel Functions, using metric() from @vercel/functions, choosing metric names and attributes, or querying emitted values with vc metrics.
name: custom-metrics
description: Emit and query Vercel Custom Metrics. Use when instrumenting application or business measurements in Vercel Functions, using metric() from @vercel/functions, choosing metric names and attributes, or querying emitted values with vc metrics.
summary: Emit numeric measurements from Functions and query them with vc metrics
metadata:
priority: 9
docs:
- "https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package"
- "https://vercel.com/docs/cli/metrics"
- "https://vercel.com/docs/observability/observability-plus"
sitemap: "https://vercel.com/sitemap/docs.xml"
pathPatterns: []
bashPatterns:
- '\b(?:vercel|vc)\s+metrics\s+(?!schema(?:\s|$)|vercel\.)[A-Za-z_][A-Za-z0-9_./-]*\b'
- '\b(?:vercel|vc)\s+metrics\s+schema\s+(?!vercel\.)[A-Za-z_][A-Za-z0-9_./-]*\b'
importPatterns: []
promptSignals:
phrases:
- "custom metric"
- "custom metrics"
- "emit a metric"
- "emit metrics"
- "report a metric"
- "report metrics"
- "application metrics"
- "business metrics"
- "@vercel/functions metric"
allOf:
- [emit, metric]
- [report, metric]
- [instrument, metric]
- [vercel, metric]
anyOf:
- "observability"
- "instrumentation"
- "duration"
- "counter"
- "percentile"
noneOf:
- "font metrics"
- "core web vitals"
minScore: 6
retrieval:
aliases:
- Vercel application metrics
- Vercel business metrics
- function metrics
- vc metrics
intents:
- emit a custom metric
- instrument a Vercel Function
- query a custom metric
- measure application behavior
entities:
- metric
- "@vercel/functions"
- Vercel Custom Metrics
- vc metrics
- Observability Plus
examples:
- emit checkout duration as a custom metric
- add a business counter to this Vercel Function
- query my custom metric with vc metrics
- group an application metric by outcomeUse Custom Metrics for numeric application and business measurements emitted by server-side code running in a Vercel Function. The workflow is **emit a numeric sample with `metric()` → invoke the deployed function → discover and query the metric with `vc metrics` or Observability**.
Install or upgrade `@vercel/functions`, then import `metric` from its root entry point:
pnpm add @vercel/functions
import { metric } from '@vercel/functions';
export async function POST() {
const startedAt = performance.now();
try {
await createOrder();
metric('orders.created', 1, { outcome: 'success' });
return Response.json({ ok: true });
} catch (error) {
metric('orders.created', 1, { outcome: 'error' });
throw error;
} finally {
metric('orders.duration_ms', performance.now() - startedAt);
}
}The signature is:
metric(name: string, value: number, tags?: Record<string, string>): void
Choose the query aggregation to match what was emitted:
| Measurement | Emit | Query | | --- | --- | --- | | Occurrence or increment | `metric('checkout.completed', 1)` | `sum` or `persecond` | | Duration or size | `metric('checkout.duration_ms', duration)` | `avg`, `p75`, `p95`, `max` | | Sampled level | `metric('queue.batch_size', size)` | `avg`, `min`, `max`, percentiles |
Run the deployed code at least once, then use the linked project and correct team scope:
vc metrics schema vc metrics schema orders.duration_ms vc metrics orders.created -a sum --group-by outcome --since 24h vc metrics orders.duration_ms -a p95 --since 1h vc metrics orders.duration_ms -a p95 --group-by outcome --since 24h --format=json
`vc` and `vercel` are equivalent. Always inspect the exact metric first with `vc metrics schema <name>` because the schema reports the available aggregations and discovered tag dimensions. Use `-S <team>` and `-p <project>` when the current link or scope is ambiguous; use `--all` only for a deliberate team-wide query.
Custom Metrics querying requires Observability Plus and availability for the selected team. If a metric is missing:
1. Confirm the function was deployed to Vercel and the instrumented path actually ran. 2. Confirm `@vercel/functions` exports `metric`; upgrade it if necessary. 3. Check `vc whoami`, the selected team, and the linked project. 4. Allow for ingestion delay, then rerun `vc metrics schema`. 5. Confirm Observability Plus and Custom Metrics are enabled for the team.
##
Comprehensive Vercel ecosystem plugin — relational knowledge graph, skills for every major product, specialized agents, and Vercel conventions. Turns any AI agent into a Vercel expert.
Repo: vercel-labs/vercel-plugin
Advanced AI agent benchmark scenarios that push Vercel's cutting-edge platform features — Workflow SDK, AI Gateway, MCP, Chat SDK, Queues, Flags, Sandbox, and…
End-to-end benchmark suite for vercel-plugin. Runs realistic projects through skill injection, launches dev servers, verifies everything works, analyzes…
Run vercel-plugin eval scenarios in Vercel Sandboxes instead of local WezTerm panels. Provisions ephemeral microVMs with Claude Code + plugin pre-installed,…
Create and launch benchmark test projects to exercise vercel-plugin skill injection across realistic scenarios. Sets up isolated directories, installs the…
Audit vercel-plugin performance on real-world projects. Extracts tool calls from Claude Code conversation logs, tests hook matching against actual inputs,…
Release vercel-plugin — run gates, bump version, generate artifacts, commit, and push. Use when asked to "release", "ship", "bump and push", or "cut a release".