Skip to content
Docs

vercel metrics

The vercel metrics command, also available as vc metrics, lets you discover and query metrics from the command line. Querying observability metrics requires Observability Plus, with product-specific exceptions listed below.

Metrics other than Web Analytics and Speed Insights metrics are available on Enterprise and Pro plans with Observability Plus

Use vercel metrics schema before you build a query. Without an argument, the command lists the metrics available to your account. Pass a metric name or prefix to inspect its dimensions and aggregations.

terminal
# List queryable metrics for the current team context
vercel metrics schema
 
# Inspect a metric or metric prefix
vercel metrics schema <metric-or-prefix>
 
# Query a custom metric and filter by an attribute
vercel metrics database.duration_ms --filter 'plan:pro'
 
# Query production data for a specific project
vercel metrics <metric_name> --since 7d --granularity 1d --project project-name --prod
 
# Query grouped results
vercel metrics <metric_name> --group-by <dimension> --since 1d --limit 5 --project project-name --prod
 
# Query across every project in the current team
vercel metrics <metric_name> --all --group-by projectId --since 24h --prod

Using the vercel metrics command to discover metrics before querying them.

Platform metric names start with vercel.. The tables below group metrics by prefix and describe what each metric measures. Use the full metric name as the <metric_name> argument:

terminal
vercel metrics vercel.function_invocation.count --since 24h

Run vercel metrics schema to see the current catalog for your team, including custom metrics. To inspect the dimensions and supported aggregations for a group or a specific metric, pass its prefix or full name:

terminal
vercel metrics schema vercel.function_invocation
vercel metrics schema vercel.function_invocation.function_duration_ms

Prefix: vercel.request

Metric nameDescription
vercel.request.countNumber of incoming requests.
vercel.request.fdt_in_bytesIncoming Fast Data Transfer, in bytes.
vercel.request.fdt_out_bytesOutgoing Fast Data Transfer, in bytes.
vercel.request.fdt_total_bytesTotal Fast Data Transfer, in bytes.
vercel.request.route_cpu_duration_msCPU time spent routing requests, in milliseconds.
vercel.request.external_rewrite_dns_msDNS lookup time for external rewrites, in milliseconds.
vercel.request.external_rewrite_connect_msConnection time for external rewrites, in milliseconds.

Prefix: vercel.function_invocation

Metric nameDescription
vercel.function_invocation.countNumber of function invocations.
vercel.function_invocation.function_duration_msFunction duration, in milliseconds.
vercel.function_invocation.function_cpu_time_msActive CPU time, in milliseconds.
vercel.function_invocation.cpu_throttle_percentCPU throttling percentage.
vercel.function_invocation.peak_memory_mbPeak memory usage, in megabytes.
vercel.function_invocation.provisioned_memory_mbProvisioned memory, in megabytes.
vercel.function_invocation.ttfb_msTime to first byte, in milliseconds.
vercel.function_invocation.fot_in_bytesIncoming Fast Origin Transfer, in bytes.
vercel.function_invocation.fot_out_bytesOutgoing Fast Origin Transfer, in bytes.
vercel.function_invocation.fot_total_bytesTotal Fast Origin Transfer, in bytes.

Prefix: vercel.middleware_invocation

Metric nameDescription
vercel.middleware_invocation.countNumber of middleware invocations.
vercel.middleware_invocation.request_duration_msRequest duration, in milliseconds.
vercel.middleware_invocation.function_cpu_time_msActive CPU time, in milliseconds.
vercel.middleware_invocation.function_duration_gbhrFunction duration weighted by memory, in gigabyte-hours.
vercel.middleware_invocation.ttfb_msTime to first byte, in milliseconds.
vercel.middleware_invocation.fot_in_bytesIncoming Fast Origin Transfer, in bytes.
vercel.middleware_invocation.fot_out_bytesOutgoing Fast Origin Transfer, in bytes.
vercel.middleware_invocation.fot_total_bytesTotal Fast Origin Transfer, in bytes.

Prefix: vercel.external_api_request

Metric nameDescription
vercel.external_api_request.countNumber of outgoing requests to external APIs.
vercel.external_api_request.request_duration_msExternal API request duration, in milliseconds.
vercel.external_api_request.transfer_bytesExternal API data transfer, in bytes.

Prefix: vercel.ai_gateway.request

Metric nameDescription
vercel.ai_gateway.request.countNumber of AI Gateway requests.
vercel.ai_gateway.request.request_duration_msRequest duration, in milliseconds.
vercel.ai_gateway.request.time_to_first_token_msTime to first token, in milliseconds.
Metric nameDescription
vercel.ai_gateway.request.input_tokensNumber of input tokens.
vercel.ai_gateway.request.output_tokensNumber of output tokens.
vercel.ai_gateway.request.cached_input_tokensNumber of cached input tokens.
vercel.ai_gateway.request.cache_creation_input_tokensNumber of input tokens used to create a cache entry.
vercel.ai_gateway.request.cache_creation1h_input_tokensNumber of input tokens used to create a one-hour cache entry.
vercel.ai_gateway.request.audio_input_tokensNumber of audio input tokens.
vercel.ai_gateway.request.audio_output_tokensNumber of audio output tokens.
vercel.ai_gateway.request.audio_duration_secondsAudio duration, in seconds.
vercel.ai_gateway.request.image_countNumber of images.
vercel.ai_gateway.request.image_input_tokensNumber of image input tokens.
vercel.ai_gateway.request.video_countNumber of videos.
vercel.ai_gateway.request.video_input_tokensNumber of video input tokens.
vercel.ai_gateway.request.video_duration_secondsVideo duration, in seconds.
vercel.ai_gateway.request.video_fpsVideo frame rate, in frames per second.
vercel.ai_gateway.request.realtime_client_message_countNumber of realtime client messages.
vercel.ai_gateway.request.realtime_session_duration_secondsRealtime session duration, in seconds.
Metric nameDescription
vercel.ai_gateway.request.gateway_tool_call_countNumber of AI Gateway tool calls.
vercel.ai_gateway.request.web_search_call_countNumber of web search calls.
vercel.ai_gateway.request.google_maps_search_call_countNumber of Google Maps search calls.
vercel.ai_gateway.request.reranking_query_countNumber of reranking queries.

All AI Gateway cost metrics use US dollars.

Metric nameDescription
vercel.ai_gateway.request.costRequest cost.
vercel.ai_gateway.request.gateway_costAI Gateway cost.
vercel.ai_gateway.request.gateway_tool_call_costAI Gateway tool call cost.
vercel.ai_gateway.request.model_allowlist_costModel allowlist cost.
vercel.ai_gateway.request.provider_allowlist_costProvider allowlist cost.
vercel.ai_gateway.request.region_pinning_costRegion pinning cost.
vercel.ai_gateway.request.zdr_costZero Data Retention cost.
vercel.ai_gateway.request.quota_write_costQuota write cost.
vercel.ai_gateway.request.reporting_write_costReporting write cost.
vercel.ai_gateway.request.surcharge_costSurcharge cost.

Prefixes: vercel.analytics.page_view and vercel.analytics.event

Metric nameDescription
vercel.analytics.page_view.countNumber of page views.
vercel.analytics.event.countNumber of custom Web Analytics events.

Prefix: vercel.speed_insights

Metric nameDescription
vercel.speed_insights.clsCumulative Layout Shift (CLS) score.
vercel.speed_insights.fcp_msFirst Contentful Paint (FCP), in milliseconds.
vercel.speed_insights.inp_msInteraction to Next Paint (INP), in milliseconds.
vercel.speed_insights.lcp_msLargest Contentful Paint (LCP), in milliseconds.
vercel.speed_insights.ttfb_msTime to first byte (TTFB), in milliseconds.

Prefix: vercel.firewall_action

Metric nameDescription
vercel.firewall_action.countNumber of Firewall actions.

Prefix: vercel.bot_id_check

Metric nameDescription
vercel.bot_id_check.countNumber of BotID checks.

Prefix: vercel.image_transformation

Metric nameDescription
vercel.image_transformation.countNumber of image transformations.
vercel.image_transformation.request_duration_msTransformation duration, in milliseconds.
vercel.image_transformation.source_size_bytesOriginal image size, in bytes.
vercel.image_transformation.optimized_size_bytesOptimized image size, in bytes.
vercel.image_transformation.compression_ratioImage compression ratio.
vercel.image_transformation.size_change_percentImage size change, as a percentage.

Prefix: vercel.isr_operation

Metric nameDescription
vercel.isr_operation.countNumber of Incremental Static Regeneration (ISR) operations.
vercel.isr_operation.read_bytesData read, in bytes.
vercel.isr_operation.read_unitsNumber of read units.
vercel.isr_operation.write_bytesData written, in bytes.
vercel.isr_operation.write_unitsNumber of write units.

Prefix: vercel.drive

Metric nameDescription
vercel.drive.read_bytesData read, in bytes.
vercel.drive.write_bytesData written, in bytes.
vercel.drive.storage_bytesStorage size, in bytes.

Prefix: vercel.sandbox

Metric nameDescription
vercel.sandbox.cpu_total_time_msActive CPU time, in milliseconds.
vercel.sandbox.cpu_usageCPU usage, as a percentage.
vercel.sandbox.memory_used_bytesMemory usage, in bytes.
vercel.sandbox.memory_peak_gb_hrPeak memory, in gigabyte-hours.
vercel.sandbox.memory_requested_gb_hrProvisioned memory, in gigabyte-hours.
vercel.sandbox.public_ingress_bytesIncoming public data transfer, in bytes.
vercel.sandbox.public_egress_bytesOutgoing public data transfer, in bytes.

Prefix: vercel.queue_operation

Metric nameDescription
vercel.queue_operation.countNumber of queue operations.
vercel.queue_operation.delivery_countMessage delivery count.
vercel.queue_operation.message_age_on_receive_msMessage age when received, in milliseconds.
vercel.queue_operation.retention_secondsMessage retention period, in seconds.
vercel.queue_operation.visibility_timeoutMessage visibility timeout, in seconds.

Prefix: vercel.workflow_operation

Metric nameDescription
vercel.workflow_operation.runsNumber of workflow runs created.
vercel.workflow_operation.run_completedNumber of completed workflow runs.
vercel.workflow_operation.run_failedNumber of failed workflow runs.
vercel.workflow_operation.run_cancelledNumber of canceled workflow runs.
vercel.workflow_operation.stepsNumber of workflow steps created.
vercel.workflow_operation.step_completedNumber of completed workflow steps.
vercel.workflow_operation.step_failedNumber of failed workflow steps.
vercel.workflow_operation.step_cancelledNumber of canceled workflow steps.

Custom metrics use the names you pass to metric() in your application, such as database.duration_ms. Their names and prefixes depend on your application, so they don't appear in the platform tables above.

Run vercel metrics schema to discover your team's custom metrics, then inspect a name or prefix before querying:

terminal
vercel metrics schema database
vercel metrics database.duration_ms --filter 'plan:pro'

By default, vercel metrics prints a human-readable table or time series summary. Use --format to output structured JSON for scripts, agents, and continuous integration checks.

Web Analytics metrics are available through vercel metrics without Observability Plus.

Speed Insights metrics are available through vercel metrics without Observability Plus.

Metrics other than Web Analytics and Speed Insights metrics require Observability Plus.

The dashboard and CLI are complementary:

  • Use product dashboards for curated views.
  • Use vercel metrics for custom filtering, grouping, aggregations, JSON output, and agent workflows.
  • Use --all to query across every project in the current team when you need team-wide comparisons.

These options only apply to the vercel metrics command.

The <metric_name> positional argument specifies the full metric name to query, such as vercel.function_invocation.count or database.duration_ms. Run vercel metrics schema to list queryable metrics for the current team context.

terminal
vercel metrics <metric_name>
vercel metrics schema

Use the schema subcommand to inspect the dimensions and aggregations available for a metric. Pass a metric name or prefix to inspect a narrower part of the schema.

terminal
vercel metrics schema
vercel metrics schema <metric-or-prefix>

Use --format when you are building scripts or agent workflows that need to validate available fields before querying.

The --aggregation option, shorthand -a, selects the aggregation for the metric.

terminal
vercel metrics <metric_name> --aggregation <aggregation>

If omitted, the CLI selects a supported aggregation based on the metric's unit. Use vercel metrics schema <metric-or-prefix> to inspect the available aggregations.

The --group-by option groups results by a dimension. Repeat it to group by multiple dimensions.

terminal
vercel metrics <metric_name> --group-by <dimension>
vercel metrics <metric_name> --group-by <dimension> --group-by <dimension>

The --filter option, shorthand -f, filters the query using Vercel's supported subset of Kibana Query Language (KQL). For custom metrics, use <attribute>:<value> to filter by an attribute:

terminal
vercel metrics database.duration_ms --filter 'plan:pro'

For platform metrics, use a dimension from the metric schema:

terminal
vercel metrics <metric_name> --filter 'environment:production'
vercel metrics <metric_name> --filter 'httpStatus >= 500'
vercel metrics <metric_name> --filter 'requestPath:(/docs* OR /guides*)'

The following KQL syntax is supported:

SyntaxDescriptionExample
field:value, field = value, or field == valueMatch a value. Values are interpreted using the dimension's type.environment:production
field != value, field > value, field >= value, field < value, or field <= valueExclude a value or compare numeric dimensions.httpStatus >= 500
field:(value1 OR value2)Match any of several values for one dimension.country:(US OR DE)
field:*, field=*, or field==*Match data where the dimension exists.errorCode:*
field:prefix*, field:*suffix, or field:*text*Match a string by prefix, suffix, or substring.requestPath:/api/*
field =~ "pattern"Match a string using a regular expression. The pattern must be double-quoted.requestPath =~ "^/api/(v1|v2)/"
AND, OR, NOT, or -expressionCombine or negate expressions. Adjacent expressions imply AND.environment:production AND NOT country:US
(expression)Control how expressions are grouped.(country:US OR country:DE) AND deviceType:mobile

Wrap the complete filter in single quotes in your shell. Double-quote values that contain spaces or KQL-reserved characters. Use a backslash to escape the next character in a quoted or unquoted value:

terminal
vercel metrics <metric_name> --filter 'requestPath:"/pricing enterprise"'

Repeat --filter to combine filters with AND:

terminal
vercel metrics <metric_name> -f 'country:US' -f 'deviceType != mobile'

The filter implementation is KQL-inspired and does not support every KQL feature. The following limits apply:

  • Filter dimensions must be available to the selected metric. Run vercel metrics schema <metric-or-prefix> to inspect them.
  • Numeric dimensions require finite numeric values, and boolean dimensions require true or false.
  • Wildcards and regular expressions require string dimensions. Wildcards are only supported at the beginning or end of a value; infix patterns such as i*d are rejected.
  • Bare quoted phrases and unfielded wildcard searches are not supported.
  • KQL nested-object syntax and Lucene fuzzy, proximity, and boosting operators are not supported.
  • Each filter can contain up to 2,048 characters and 8 levels of nesting. A query can contain up to 50 expression nodes across all filters.

OData filter syntax is deprecated. Use KQL for new queries.

The --prod option limits the query to production data. It is equivalent to --filter 'environment:production'.

terminal
vercel metrics <metric_name> --prod

The --since option, shorthand -s, sets the start of the time range. You can use a relative duration like 1h, 24h, or 7d, a date, or an ISO timestamp. If omitted, the CLI defaults to the last hour.

terminal
vercel metrics <metric_name> --since 24h

The --until option, shorthand -u, sets the end of the time range. If omitted, the command uses the current time.

terminal
vercel metrics <metric_name> --since 24h --until 2026-03-19T12:00:00Z

The --granularity option, shorthand -g, controls the time bucket size. If omitted, the CLI computes a granularity for the selected time range.

terminal
vercel metrics <metric_name> --granularity 1h --since 7d

The --limit option, shorthand -l, sets the maximum number of grouped results returned per time bucket. The default is 10.

terminal
vercel metrics <metric_name> --group-by <dimension> --limit 50

The --order-by option only applies to grouped results, so use it with --group-by. The default is count when the metric supports counting data points and value otherwise. Use --order-by value to order groups by the actual metric value returned by the query.

terminal
vercel metrics <metric_name> --group-by <dimension> --order-by count
vercel metrics <metric_name> --group-by <dimension> --order-by value

The --order option sets the ordering direction for grouped results. It accepts asc or desc. The default is desc.

terminal
vercel metrics <metric_name> --group-by <dimension> --order-by value --order asc

The --project option, shorthand -p, specifies the project name or project ID to query. Use it when you want results for a specific project. It defaults to the linked project when --all is not set.

terminal
vercel metrics <metric_name> --project project-name --prod

The --all option queries across all projects in the current team scope. It cannot be combined with --project.

terminal
vercel metrics <metric_name> --all --group-by projectId --prod

The --format option outputs JSON instead of text. Use it for automation and agents.

terminal
vercel metrics <metric_name> --format json
vercel metrics schema <metric-or-prefix> --format json

Inspect the schema before building a query:

terminal
vercel metrics schema <metric-or-prefix>

List all available metrics:

terminal
vercel metrics schema

Query a custom metric for the pro plan:

terminal
vercel metrics database.duration_ms --filter 'plan:pro'

Query a metric for the last seven days:

terminal
vercel metrics <metric_name> --since 7d --granularity 1d --project project-name --prod

Query grouped results for a specific project:

terminal
vercel metrics <metric_name> --group-by <dimension> --since 24h --project project-name --prod

Query production data across every project in the current team:

terminal
vercel metrics <metric_name> --all --group-by projectId --since 24h --prod

The following global options can be passed when using the vercel metrics command:

For more information on global options and their usage, refer to the options section.

Last updated September 10, 2026

Was this helpful?

supported.