Skip to content

[skills] Sync cdn-caching with current docs - #463

Merged
molebox merged 3 commits into
mainfrom
eve-drift/cdn-caching
Nov 26, 2026
Merged

molebox merged 3 commits into
mainfrom
eve-drift/cdn-caching

Conversation

@vercel-gh-bot-2

Copy link
Copy Markdown
Contributor

The vercel metrics examples in this skill used the old snake_case dimension names (cache_result, path_type, request_path, cache_reason, ppr_state, bot_category, request_method, user_agent). Those names belong to the legacy metrics backend. Since Vercel CLI 59.12.0, vercel metrics uses the new Observability metrics API by default, and that API names dimensions in camelCase. The CLI sends --group-by and -q names to that API unchanged. Its own help examples switch to camelCase when the new API is in use (packages/cli/src/commands/metrics/command.ts: const httpStatus = canonical ? 'httpStatus' : 'http_status';).

  • --group-by cache_reason → --group-by cacheReason. Source: https://vercel.com/kb/guide/how-to-reduce-isr-revalidation-costs (last_updated 2026-11-06): "vercel metrics vercel.request.count --group-by cacheReason --since 24h".
  • cache_result (filters, group-by, prose) → cacheResult, and --group-by request_method → --group-by requestMethod. Source: https://vercel.com/docs/cli/logs (last_updated 2026-02-10), which queries the same Observability API: "vercel logs requests --query 'requestMethod:POST AND cacheResult:MISS'".
  • request_path → requestPath. Source: https://vercel.com/docs/cli/metrics (last_updated 2026-09-10): "vercel metrics <metric_name> --query 'requestPath:(/docs* OR /guides*)'". The same page also uses projectId, httpStatus and errorCode.
  • path_type → pathType. Source: https://vercel.com/docs/observability/custom-metrics lists pathType ("Execution path type that emitted the metric.") among the metadata Vercel collects automatically for metrics.
  • --group-by bot_category → --group-by botCategory, and --group-by user_agent → --group-by clientUserAgent. Source: packages/cli/src/util/firewall/dimensions.ts, which defines field: 'botCategory' and alias: 'user-agent', field: 'clientUserAgent'. The firewall commands query the same Observability API.
  • --group-by ppr_state → --group-by pprState. This is the inferred camelCase name: no docs page or current CLI source confirms pprState as a metrics dimension. The intro note flags it for checking with vercel metrics schema.
  • When the new API became the default. packages/cli/CHANGELOG.md 59.12.0 (ef5c9f7): "Use the new Observability metrics API by default, surface its rate limits without retrying, and add FF_LEGACY_METRICS=1 to restore the legacy metrics behavior." For firewall queries on the same engine, the CHANGELOG adds (0239c8e) that "the dimension names it accepts are the schema's camelCase ones".
  • Added a note to the metrics intro paragraph. It says vercel metrics uses the Observability metrics API by default since CLI 59.12, with camelCase dimension names (FF_LEGACY_METRICS=1 falls back to the legacy API and its snake_case names). It also asks readers to check pprState, cache_tags, and triggering_tag with vercel metrics schema before running those examples.

Verification

run_plugin_checks passed every step: build, typecheck, validate, and test (1364 pass, 0 fail).

Test updates

None.

Not changed

  • --group-by cache_tags and triggering_tag (filter and group-by) keep their legacy names. No docs page or CLI source confirms their camelCase names; the intro note flags them instead.
  • "REVALIDATED … (or Pragma: no-cache)" is not on https://vercel.com/docs/caching/cache-status or https://vercel.com/docs/headers/response-headers. Left as is.
  • "needs Observability Plus or a Priority project" for vercel logs requests is left as is. CLI source (packages/cli/src/commands/logs/errors.ts) also accepts "the Enterprise Agents & Apps entitlement".
  • Frontmatter retrieval/promptSignals entries (ppr_state, etc.) are matching fields and were not touched.
  • skills/vercel-cli/references/monitoring-and-debugging.md (and its upstream/ copy) still use the legacy http_status, error_code, and project_id metrics dimensions. That is a different skill, so it needs its own follow-up.

Opened automatically by the vercel-plugin drift agent. Review before merge.

<!-- vercel-plugin-drift-agent -->
molebox and others added 2 commits November 26, 2026 12:10
…EGACY_METRICS, drop sum on request count

- `cache_tags` -> `cacheTags` and `triggering_tag` -> `triggeringTag` in the
  `vercel metrics` examples, and drop the "aren't confirmed" note. The
  Observability metrics API accepts only its camelCase catalog names:
  `vercel.request.count` lists `cacheTags`, `cacheReason`, `pprState` and
  `triggeringTag`; `vercel.isr_operation.*` lists `cacheTags` and has no
  `triggeringTag`.
- `FF_LEGACY_METRICS=1` exists only on CLI 59.12-65.11. CLI 65.12.0 removed it
  and always uses the Observability metrics API.
- Drop `--aggregation sum` from the two `vercel.request.count` commands. Count
  metrics accept only `count` and `unique` on the Observability metrics API,
  and the CLI picks `count` when the flag is omitted.
- Say what CLIs before 59.12 need: the legacy API's snake_case names and OData
  filters.

Sources:
- @vercel/o11y-tools@0.105.0/dist/contracts/metrics.mjs (metric catalog:
  `countAggregations` is ["count", "unique"] and `vercel.request.count` is a
  count metric over `incomingRequestDimensions`, which lists `cacheTags`,
  `pprState` and `triggeringTag`; `isrOperationDimensions` lists `cacheTags`
  and no `triggeringTag`)
- vercel@59.11.7 dist (new API opt-in via FF_METRICS), vercel@59.12.0 dist
  (FF_LEGACY_METRICS added)
- @vercel/cli-support@65.11.0/dist/chunks/query-67KQVLTR.js (FF_LEGACY_METRICS
  present), @vercel/cli-support@65.12.0 dist (FF_LEGACY_METRICS absent from
  every file)
- vercel/vercel@155eacfa1684:packages/cli/CHANGELOG.md (59.12.0 ef5c9f7,
  59.16.0 0239c8e)
- vercel/vercel@155eacfa1684:packages/cli/src/commands/metrics/query.ts
  (default aggregation falls back to count; group-by and filter names are sent
  unchanged)
- vercel/vercel@155eacfa1684:packages/cli/src/commands/metrics/command.ts
  (legacy API: OData filters, snake_case names)
- https://vercel.com/docs/cli/metrics

@molebox molebox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent from Rich's agents review

Verified the drift commit cba1d15 against the published CLI and the published metric catalog, and pushed fix commit ffecb6a.

  • The camelCase names hold for vercel.request.count and vercel.isr_operation.*: cacheResult, pathType, requestPath, requestMethod, clientUserAgent, botCategory, cacheReason, pprState. Sources: @vercel/o11y-tools@0.105.0/dist/contracts/metrics.mjs, https://vercel.com/docs/cli/metrics, https://vercel.com/kb/guide/how-to-reduce-isr-revalidation-costs
  • The Observability metrics API is the default since CLI 59.12: vercel/vercel@155eacf:packages/cli/CHANGELOG.md (59.12.0).
  • Fixed: FF_LEGACY_METRICS exists only on CLI 59.12-65.11. @vercel/cli-support@65.11.0/dist/chunks/query-67KQVLTR.js has it; no file in @vercel/cli-support@65.12.0 does.
  • Fixed: cache_tags to cacheTags and triggering_tag to triggeringTag, and removed the "aren't confirmed" note. The catalog lists cacheTags, pprState and triggeringTag for request count, and cacheTags for ISR operations.
  • Fixed: dropped --aggregation sum from the two vercel.request.count commands. In the catalog, count metrics take count or unique, and the CLI defaults to count.
  • #417 edits the same block and will need a rebase after this merges. Both sides agree on cacheResult and on count for request count.

Gated head c0d8209 (this branch merged with main abe19cc): bun run build:all leaves no diff; typecheck, validate and bun test pass; CI build-and-test passes on it.

@molebox
molebox merged commit 7c75338 into main Nov 26, 2026
5 checks passed
@molebox
molebox deleted the eve-drift/cdn-caching branch November 26, 2026 11:24
@molebox molebox mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant