Skip to content

Commit 78de7b5

Browse files
authored
Merge pull request #76 from vercel/add-vc-metrics-usage
Add Vercel metrics CLI guidance
2 parents ec4414d + e6cbaf4 commit 78de7b5

12 files changed

Lines changed: 59 additions & 14 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vercel",
3-
"version": "0.42.0",
3+
"version": "0.42.1",
44
"description": "Build and deploy web apps and agents",
55
"author": {
66
"name": "Vercel",

.cursor-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vercel",
3-
"version": "0.42.0",
3+
"version": "0.42.1",
44
"description": "Build and deploy web apps and agents",
55
"author": {
66
"name": "Vercel",

.plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vercel-plugin",
3-
"version": "0.42.0",
3+
"version": "0.42.1",
44
"description": "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.",
55
"author": {
66
"name": "Vercel",

commands/status.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ If drains are unavailable (Hobby plan or not yet configured), use these alternat
173173
| Query logs programmatically | **MCP / REST API** | `get_runtime_logs` tool or `/v3/deployments/:id/events` |
174174
| Monitor errors post-deploy | **CLI** | `vercel logs <url> --level error --since 1h` |
175175
| Web Analytics data | **Dashboard only** | `https://vercel.com/{team}/{project}/analytics` |
176-
| Performance metrics | **Dashboard only** | `https://vercel.com/{team}/{project}/speed-insights` |
176+
| Observability metrics | **Vercel CLI** | `vercel metrics schema`, then `vercel metrics <metric-id> --format=json` |
177+
| Speed Insights dashboard | **Dashboard** | `https://vercel.com/{team}/{project}/speed-insights` |
177178

178179
> **Upgrade path:** When ready for centralized observability, upgrade to Pro and configure drains at `https://vercel.com/dashboard/{team}/~/settings/log-drains` or via REST API. The drain setup is typically < 5 minutes.
179180
@@ -183,7 +184,8 @@ If drains are unavailable (Hobby plan or not yet configured), use these alternat
183184
|------|-----|-----|
184185
| Page views, traffic sources | Web Analytics | First-party, privacy-friendly |
185186
| Business event tracking | Web Analytics custom events | Track conversions, feature usage |
186-
| Core Web Vitals monitoring | Speed Insights | Real user data per route |
187+
| Core Web Vitals monitoring | Speed Insights + `vercel metrics vercel.speed_insights_metric.lcp -a p75 --group-by route --since 7d` | Real user data per route |
188+
| Query platform metrics | `vercel metrics` / `vc metrics` | Function invocations, request counts, AI Gateway spend, Speed Insights, grouped by schema dimensions |
187189
| Function debugging | Runtime Logs (CLI `vercel logs` / Dashboard (`https://vercel.com/{team}/{project}/logs`) / REST) | Real-time, per-invocation logs |
188190
| Export logs to external platform | Drains (JSON/NDJSON/Syslog) | Centralize observability (Pro+) |
189191
| Export analytics data | Drains (Web Analytics type) | Warehouse pageviews + custom events (Pro+) |
@@ -202,6 +204,7 @@ Confirm each data source returned successfully:
202204
- [ ] Domain list retrieved (or "no custom domains")
203205
- [ ] vercel.json parsed (or "not present")
204206
- [ ] Drain status checked (count, errored drains identified)
207+
- [ ] Metrics schema checked with `vercel metrics schema --format=json` when CLI auth/team scope is available
205208
- [ ] Analytics/Speed Insights instrumentation detected (or gap flagged)
206209
- [ ] Drain signature secret checked (if drains configured)
207210

commands/status.md.tmpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ If drains are unavailable (Hobby plan or not yet configured), use these alternat
173173
| Query logs programmatically | **MCP / REST API** | `get_runtime_logs` tool or `/v3/deployments/:id/events` |
174174
| Monitor errors post-deploy | **CLI** | `vercel logs <url> --level error --since 1h` |
175175
| Web Analytics data | **Dashboard only** | `https://vercel.com/{team}/{project}/analytics` |
176-
| Performance metrics | **Dashboard only** | `https://vercel.com/{team}/{project}/speed-insights` |
176+
| Observability metrics | **Vercel CLI** | `vercel metrics schema`, then `vercel metrics <metric-id> --format=json` |
177+
| Speed Insights dashboard | **Dashboard** | `https://vercel.com/{team}/{project}/speed-insights` |
177178

178179
> **Upgrade path:** When ready for centralized observability, upgrade to Pro and configure drains at `https://vercel.com/dashboard/{team}/~/settings/log-drains` or via REST API. The drain setup is typically < 5 minutes.
179180

@@ -183,7 +184,8 @@ If drains are unavailable (Hobby plan or not yet configured), use these alternat
183184
|------|-----|-----|
184185
| Page views, traffic sources | Web Analytics | First-party, privacy-friendly |
185186
| Business event tracking | Web Analytics custom events | Track conversions, feature usage |
186-
| Core Web Vitals monitoring | Speed Insights | Real user data per route |
187+
| Core Web Vitals monitoring | Speed Insights + `vercel metrics vercel.speed_insights_metric.lcp -a p75 --group-by route --since 7d` | Real user data per route |
188+
| Query platform metrics | `vercel metrics` / `vc metrics` | Function invocations, request counts, AI Gateway spend, Speed Insights, grouped by schema dimensions |
187189
| Function debugging | Runtime Logs (CLI `vercel logs` / Dashboard (`https://vercel.com/{team}/{project}/logs`) / REST) | Real-time, per-invocation logs |
188190
| Export logs to external platform | Drains (JSON/NDJSON/Syslog) | Centralize observability (Pro+) |
189191
| Export analytics data | Drains (Web Analytics type) | Warehouse pageviews + custom events (Pro+) |
@@ -202,6 +204,7 @@ Confirm each data source returned successfully:
202204
- [ ] Domain list retrieved (or "no custom domains")
203205
- [ ] vercel.json parsed (or "not present")
204206
- [ ] Drain status checked (count, errored drains identified)
207+
- [ ] Metrics schema checked with `vercel metrics schema --format=json` when CLI auth/team scope is available
205208
- [ ] Analytics/Speed Insights instrumentation detected (or gap flagged)
206209
- [ ] Drain signature secret checked (if drains configured)
207210

generated/skill-manifest.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@
773773
"deployment status",
774774
"deploy status",
775775
"vercel logs",
776+
"vercel metrics",
776777
"deployment logs",
777778
"deploy logs",
778779
"vercel inspect",
@@ -800,6 +801,10 @@
800801
"vercel",
801802
"logs"
802803
],
804+
[
805+
"vercel",
806+
"metrics"
807+
],
803808
[
804809
"deploy",
805810
"error"
@@ -844,7 +849,8 @@
844849
"vercel deploy",
845850
"vercel env",
846851
"vercel link",
847-
"vercel logs"
852+
"vercel logs",
853+
"vercel metrics"
848854
],
849855
"examples": []
850856
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vercel-plugin",
3-
"version": "0.42.0",
3+
"version": "0.42.1",
44
"private": true,
55
"bin": {
66
"vercel-plugin": "src/cli/index.ts"

skills/vercel-cli/SKILL.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: vercel-cli
3-
description: Vercel CLI expert guidance. Use when deploying, managing environment variables, linking projects, viewing logs, managing domains, or interacting with the Vercel platform from the command line.
3+
description: Vercel CLI expert guidance. Use when deploying, managing environment variables, linking projects, viewing logs, querying metrics, managing domains, or interacting with the Vercel platform from the command line.
44
metadata:
55
priority: 4
66
docs:
@@ -27,6 +27,7 @@ metadata:
2727
- "deployment status"
2828
- "deploy status"
2929
- "vercel logs"
30+
- "vercel metrics"
3031
- "deployment logs"
3132
- "deploy logs"
3233
- "vercel inspect"
@@ -41,6 +42,7 @@ metadata:
4142
- [check, deploy]
4243
- [vercel, status]
4344
- [vercel, logs]
45+
- [vercel, metrics]
4446
- [deploy, error]
4547
- [deploy, failed]
4648
- [deploy, stuck]
@@ -71,6 +73,7 @@ retrieval:
7173
- vercel env
7274
- vercel link
7375
- vercel logs
76+
- vercel metrics
7477
chainTo:
7578
-
7679
pattern: '"functions"\s*:\s*\{|"maxDuration"\s*:|"memory"\s*:'
@@ -123,7 +126,7 @@ Use this to route to the correct reference file:
123126
- **CI/CD automation**`references/ci-automation.md`
124127
- **Domains or DNS**`references/domains-and-dns.md`
125128
- **Projects or teams**`references/projects-and-teams.md`
126-
- **Logs, debugging, or accessing preview deploys**`references/monitoring-and-debugging.md`
129+
- **Logs, metrics, debugging, or accessing preview deploys**`references/monitoring-and-debugging.md`
127130
- **Blob storage**`references/storage.md`
128131
- **Integrations (databases, storage, etc.)**`references/integrations.md`
129132
- **Access a preview deployment** → use `vercel curl` (see `references/monitoring-and-debugging.md`)

skills/vercel-cli/overlay.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: vercel-cli
2-
description: Vercel CLI expert guidance. Use when deploying, managing environment variables, linking projects, viewing logs, managing domains, or interacting with the Vercel platform from the command line.
2+
description: Vercel CLI expert guidance. Use when deploying, managing environment variables, linking projects, viewing logs, querying metrics, managing domains, or interacting with the Vercel platform from the command line.
33
metadata:
44
priority: 4
55
docs:
@@ -26,6 +26,7 @@ metadata:
2626
- "deployment status"
2727
- "deploy status"
2828
- "vercel logs"
29+
- "vercel metrics"
2930
- "deployment logs"
3031
- "deploy logs"
3132
- "vercel inspect"
@@ -40,6 +41,7 @@ metadata:
4041
- [check, deploy]
4142
- [vercel, status]
4243
- [vercel, logs]
44+
- [vercel, metrics]
4345
- [deploy, error]
4446
- [deploy, failed]
4547
- [deploy, stuck]
@@ -70,6 +72,7 @@ retrieval:
7072
- vercel env
7173
- vercel link
7274
- vercel logs
75+
- vercel metrics
7376
chainTo:
7477
-
7578
pattern: '"functions"\s*:\s*\{|"maxDuration"\s*:|"memory"\s*:'
@@ -80,4 +83,3 @@ chainTo:
8083
pattern: '"redirects"\s*:\s*\[|"rewrites"\s*:\s*\[|"headers"\s*:\s*\['
8184
targetSkill: routing-middleware
8285
message: 'Routing rules in vercel.json — loading Routing Middleware guidance for platform-level request interception patterns.'
83-

skills/vercel-cli/references/monitoring-and-debugging.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ vercel logs --since 2024-01-01 # filter by time
1111
vercel logs --query "timeout" # search
1212
```
1313

14+
## Metrics
15+
16+
```bash
17+
vercel metrics schema # list available metrics
18+
vercel metrics schema vercel.function_invocation # inspect a metric prefix
19+
vercel metrics vercel.function_invocation.count --since 1h # query linked project
20+
vercel metrics vercel.request.count --group-by http_status --since 6h # group by schema dimension
21+
vercel metrics vercel.function_invocation.request_duration_ms -a avg --group-by route --since 1h
22+
vercel metrics vercel.ai_gateway_request.cost -a sum --group-by ai_provider --since 7d
23+
vercel metrics vercel.speed_insights_metric.lcp -a p75 --group-by route --since 7d
24+
vercel metrics --all vercel.function_invocation.count --group-by project_id --since 24h
25+
vercel metrics vercel.function_invocation.count -f "http_status ge 500" --group-by error_code --since 1h --format=json
26+
```
27+
1428
## Inspecting Deployments
1529

1630
```bash

0 commit comments

Comments
 (0)