Vercel Observability Adds Custom Metrics

💡Track app-specific and AI workload metrics directly in Vercel without building a separate monitoring pipeline.
⚡ 30-Second TL;DR
What Changed
Use the metric() function from the @vercel/functions package to record values such as request latency or business events.
Why It Matters
This gives teams more visibility into application-specific and AI workload metrics without deploying a separate monitoring pipeline. It can help builders correlate function performance with business events, though observability-event charges should be monitored at scale.
What To Do Next
Instrument one latency or model-inference business metric with metric() in @vercel/functions, then build a dashboard to validate its usefulness and cost.
Key Points
- •Use the metric() function from the @vercel/functions package to record values such as request latency or business events.
- •Attach attributes to custom metrics for filtering and grouping, with Vercel automatically adding deployment and function-region metadata.
- •Custom metrics are available in the query builder, Notebooks, dashboards, and through the vc metrics CLI command.
- •The feature is available to Pro and Enterprise customers with Observability Plus, and usage is billed as observability events.
🧠 Deep Insight
Background and context from public sources — not the original article. 17 sources cited.
🔑 Enhanced Key Takeaways
- •Custom metrics emitted from Vercel Functions are billed as Observability events at a rate of $1.20 per 1 million events.
- •The names of custom metrics and their attributes, along with attribute values, must be non-empty, shorter than 64 bytes, and restricted to ASCII letters, digits, hyphens, underscores, periods, and slashes.
- •The
vercel metricsCLI command offers advanced querying capabilities for custom metrics, including custom filtering, grouping, aggregations, calendar buckets, and JSON output, with the ability to query across all projects within a team. - •Vercel Observability already provides a suite of built-in metrics for Vercel Functions, covering aspects like invocations, durations, error rates, in-function concurrency, external API requests, Edge Requests, Fast Data Transfer, Builds, and ISR caching, which custom metrics are designed to complement.
- •Vercel's AI Gateway, a related offering, also features its own observability, logging spend, model usage, and performance metrics for AI requests, viewable at both team and project levels.
📊 Competitor Analysis▸ Show
Competitor Analysis: Vercel Observability vs. Key Platforms
| Feature/Platform | Vercel Observability (with Custom Metrics) | Netlify Observability | AWS CloudWatch (for Lambda) |
|---|---|---|---|
| Core Offering | Frontend Cloud with integrated serverless functions and comprehensive observability. | Frontend Cloud with integrated serverless functions and general observability. | Native monitoring and logging for AWS resources, including serverless functions. |
| Custom Metrics | Yes, via @vercel/functions metric() function; record numeric values with attributes. | General observability features, specific custom metrics functionality less detailed in public info. | Yes, supports custom metrics for Lambda functions. |
| Built-in Metrics | Vercel Functions usage (invocations, duration, errors, CPU, memory), Edge Requests, Builds, ISR caching, External API calls. | Function invocations, bandwidth, build minutes. | Lambda invocations, duration, error rates, throttles, concurrent executions, memory usage. |
| Data Retention | 30 days for Observability Plus. | Varies by plan (e.g., 3 days on Pro for Connect events). | Configurable, typically 14 months for metrics, longer for logs. |
| Querying/Analysis | Query builder, Notebooks, dashboards, vc metrics CLI for filtering, grouping, aggregations. | Dashboards, logs. | CloudWatch Logs Insights for querying logs, CloudWatch Metrics for dashboards and alarms. |
| Pricing Model | Observability Plus: $1.20 per 1 million events. | Credit-based across various usage (compute, bandwidth, database, AI inference). Pro plan includes unlimited team members. | Pay-as-you-go for logs ingested, metrics stored, alarms, etc. |
| Latency/Delay | Real-time insights. | Real-time insights. | Metrics can have up to one-minute delay. |
| External Integration | Vercel Drains for exporting logs, traces (OpenTelemetry), analytics, performance metrics to external tools (Datadog, Honeycomb, etc.). | Log Drains to external logging providers. | Integrates with AWS X-Ray for distributed tracing; supports various third-party tools. |
| Target Audience | Developers building Next.js and modern web applications requiring integrated DX and observability. | Developers building JAMstack and framework-neutral web applications. | AWS users needing deep integration within the AWS ecosystem. |
🛠️ Technical Deep Dive
- Custom metrics are emitted using the
metric()function from the@vercel/functionspackage within Vercel Functions. - Each call to
metric()records a single numeric data point. - Developers can attach custom attributes to these metrics for enhanced filtering and grouping.
- Vercel automatically enriches custom metrics with metadata such as deployment ID and function-region.
- Metric names, attribute names, and attribute values must adhere to specific constraints: they must be non-empty, shorter than 64 bytes, and contain only ASCII letters (A-Z, a-z), digits (0-9), hyphens (-), underscores (_), periods (.), and slashes (/). Unsupported characters are automatically replaced with an underscore.
- Recorded custom metrics are accessible through Vercel Observability's query builder, Notebooks, dashboards, and the
vc metricsCLI command for analysis and visualization.
🔮 Future ImplicationsAI analysis grounded in cited sources
⏳ Timeline
📎 Sources (17)
Factual claims are grounded in the sources below. Forward-looking analysis is AI-generated interpretation.
Weekly AI Recap
Read this week's curated digest of top AI events →
👉Related Updates
AI-curated news aggregator. All content rights belong to original publishers.
Original source: Vercel News ↗
This is a summary, not the original. Read the source, or get the weekly briefing.
Weekly AI briefing
One email a week. Unsubscribe anytime.