Vercel
Send traces from your Vercel projects to Everr with a Vercel Trace Drain. No code changes needed for function and fetch spans.
This guide shows you how to send traces from your Vercel projects to Everr. Vercel traces your functions for you and forwards the traces over OpenTelemetry (OTLP) through a Trace Drain, so you add Everr as a drain and Vercel does the rest.
Once it's set up, you get:
- A trace for every function invocation, with spans for routing, middleware, and caching
- A span for every outgoing
fetchyour functions make - Route and rendering spans on Next.js 13.4 and later
- Any custom spans you create with
@vercel/otel
Prerequisites
- A Vercel team on the Pro or Enterprise plan. Drains aren't available on Hobby.
- Permission to manage drains in the team settings
- An Everr API key with the Send telemetry capability (see Mint an API key)
Step 1. Add Everr as a Trace Drain
A drain belongs to your Vercel team and can forward traces from every project in it, or only from the projects you pick.
In the Vercel dashboard, open Team Settings > Drains and select Add Drain:
- Under data type, choose Traces.
- Name the drain, such as
everr, and select the projects to send. - Leave the sampling rules empty to forward every trace. See Control volume and cost to send less.
- Under destination, choose Custom Endpoint and fill in:
| Field | Value |
|---|---|
| Endpoint URL | https://ingest.everr.dev/v1/traces |
| Format | Protobuf |
| Custom Headers | Authorization: Bearer <your-api-key> |
- Select Create Drain. Vercel sends a test delivery to the endpoint, so a wrong URL or key shows up right away.
If you prefer the CLI, create the same drain with vercel drains create:
vercel drains create \
--name everr \
--type traces \
--url https://ingest.everr.dev/v1/traces \
--encoding proto \
--header "Authorization: Bearer <your-api-key>"Validate
Send a few requests to a deployed project, then:
- In the Vercel dashboard, open Team Settings > Drains. The drain should show no errors. Vercel also emails you if most deliveries fail.
- In Everr, open Traces and look for your project's invocations. Vercel adds
vercel.project_idandvercel.deployment_idto every trace, so you can filter by project or by deployment.
Add custom spans
Function, fetch, and Next.js spans need no code. To trace your own code, install @vercel/otel:
npm i @opentelemetry/api @vercel/otelRegister it in instrumentation.ts at the root of your project (or in src on Next.js):
import { registerOTel } from "@vercel/otel";
export function register() {
registerOTel({ serviceName: process.env.VERCEL_PROJECT_NAME });
}Then wrap the code you want to time in a span:
import { trace } from "@opentelemetry/api";
const tracer = trace.getTracer("app");
const result = await tracer.startActiveSpan("operation name", async (span) => {
try {
span.setAttribute("app.attribute", "value");
return await yourCode();
} finally {
span.end();
}
});Create custom spans with @vercel/otel. If you register your own OpenTelemetry SDK instead, Vercel turns off the Trace Drain for that project. To use your own SDK, skip the drain and export straight to Everr as in Any OpenTelemetry SDK. See Vercel's instrumentation guide for the full set of options.
Control volume and cost
- Sampling. Add sampling rules to the drain to forward a share of traces, per environment and optionally per path prefix, such as 10% of production traffic. Vercel checks the rules top to bottom and uses the first one that matches. Once a drain has rules, requests that match none of them aren't forwarded. Sampling keeps or drops whole traces, never single spans.
- Billing. Vercel bills drains by volume, measured as the uncompressed JSON size of the data even when you send Protobuf. Sampling is the main way to lower it.
Limitations
- No logs. Vercel's log drains use Vercel's own JSON format, not OpenTelemetry, so Everr can't receive them yet. Trace Drains carry traces only.
- No custom spans on the Edge runtime. Vercel drops custom spans created in Edge functions.
- Large spans are trimmed. Vercel truncates the largest attributes of a span over 1 MB compressed, marks each with a
<attribute>.truncatedattribute, and drops spans that are still too large.