summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErgün Erdoğmuş <erdogmusergun@gmail.com>2026-11-12 11:05:46 +0100
committerGitHub <noreply@github.com>2026-11-12 11:05:46 +0100
commita4830052c795edbce8f991debc69a24d2171785a (patch)
tree5177757c6df8284f720443c83fdd88265fde8c8e
parent1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62 (diff)
vercel-optimize: document queryId and meta in vercel metrics JSONvercel-optimize-metrics-json-meta
Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
-rw-r--r--skills/vercel-optimize/references/data-collection.md12
1 files changed, 11 insertions, 1 deletions
diff --git a/skills/vercel-optimize/references/data-collection.md b/skills/vercel-optimize/references/data-collection.md
index 140c787..93bcb17 100644
--- a/skills/vercel-optimize/references/data-collection.md
+++ b/skills/vercel-optimize/references/data-collection.md
@@ -154,12 +154,22 @@ The skill never crashes the entire collection on a single endpoint failure. Ever
{ "timestamp": "2026-04-13T04:00:00.000Z", "vercel_request_count_sum": 0, "route": "/dashboard/[sessionId]" }
/* ... */
],
- "statistics": { "bytesRead": 10267, "rowsRead": 947, "dbTimeSeconds": 0 }
+ "statistics": { "bytesRead": 10267, "rowsRead": 947, "dbTimeSeconds": 0 },
+ // Newer CLIs (with `vercel metrics --data`) also return:
+ "queryId": "observability-api-...",
+ "meta": {
+ "outputs": {
+ "vercel_request_count_sum": { "kind": "metric", "metric": "vercel.request.count", "unit": "count" }
+ },
+ "effectiveTimeRange": { "start": "2026-04-13T04:00:00.000Z", "end": "2026-05-13T08:00:00.000Z" }
+ }
}
```
Field naming rule: the metric ID's dots become underscores, and the aggregation suffix is appended — `vercel.request.count` + `sum` → `vercel_request_count_sum`. `lib/vercel.mjs::normalizeSummary()` flattens `summary[]` into `[{<dim>: v, ..., value: <n>}]`.
+`queryId` and `meta` are additive, so the collector ignores them. On those CLIs, `query.startTime` and `query.endTime` report the range the API actually queried (`meta.effectiveTimeRange`, after bucket alignment), which can be wider than the requested `--since` window. `meta.outputs` is keyed by the same `<metric>_<aggregation>` column, and `meta.excludedIntervals` lists Observability Plus periods left out of the result. `vercel metrics --data` returns the same `query`/`summary`/`data` layout with one column per output alias, for queries with several metrics or formulas.
+
### `vercel metrics schema --format json`
Array of `{id, description}` entries — NOT an object. Many metric IDs in earlier docs don't exist: there is no `vercel.function.cold_starts`, no `vercel.cache.hits`. Cache state is the `cache_result` dimension on `vercel.request.count`.