When to use this
- You want spans from your own code: database queries, calls to other services, AI model and tool calls.
- You want those spans to continue into services outside Vercel.
- Your functions produce a lot of telemetry per request, where the drain’s $0.50 per GB adds up.
Bronto OTLP endpoint
Exporters append
/v1/traces, /v1/metrics and /v1/logs. Authenticate with the header x-bronto-api-key. See API Keys.
Next.js (and other frameworks) with @vercel/otel
-
Install the package:
-
Register it in
instrumentation.tsin the project root (or insrc/):instrumentation.ts -
Set the exporter in the project’s environment variables (Settings → Environment Variables):
Values are percent-decoded (W3C Baggage format), so encode a comma, semicolon or
%inside a value. An=at the end of an API key can stay as it is. - Redeploy. Spans appear in Explore Traces under the service name you set.
fetch client spans, and your own spans created with the OpenTelemetry API. These spans share one trace with Vercel’s infrastructure spans for the same request (Resolve Route, Invoke Middleware, Invoke Function), which reach Bronto through a trace drain. Spans from functions on the Edge runtime are not supported.
@vercel/otel adds resource attributes such as vercel.project_id, vercel.deployment_id, vercel.region and vercel.sha, so you can filter by deployment.
With a trace drain on the same project
A trace drain forwards your own spans too, not only Vercel’s infrastructure spans (vercel.edge-network, vercel.serverless-runtime). @vercel/otel (2.1 and later) is built to skip its OTEL_EXPORTER_OTLP_* exporter while a trace drain is configured, so that spans travel through the drain only. In a test project with both, that didn’t happen: every span of the Next.js app and of an eve agent arrived twice, once through the direct export and once through the trace drain, and the duplicates were about two thirds of the trace drain’s spans.
Choose one path for your own spans:
- Through the trace drain: remove the direct exporter (or don’t set
OTEL_EXPORTER_OTLP_*). Your spans are billed as drain volume at $0.50 per GB. - Direct export: keep
OTEL_EXPORTER_OTLP_*and don’t add a trace drain. The export costs function time instead of drain fees (see below), but Vercel’s infrastructure spans then don’t reach Bronto.
otelIntegration, always export directly, so with a trace drain their spans arrive twice as well.
Agents built with eve
eve has OpenTelemetry built in: model calls, tool calls and agent turns become spans that follow the GenAI semantic conventions (gen_ai.provider.name, gen_ai.usage.input_tokens, gen_ai.tool.name, …). Add an OTLP exporter in agent/instrumentation/:
agent/instrumentation/otlp.ts
OTEL_EXPORTER_OTLP_* variables as @vercel/otel, so a Next.js app and an eve agent in one project share one configuration. Version 0.223 matches the OpenTelemetry JS 2.x packages that @vercel/otel 2 uses.
eve starts a new trace for each agent turn. To carry the trace into the services your tools call, add the undici instrumentation, as shown in Tracing into other services.
What exporting costs
The exporter sends spans over the network, and the function stays billed while it waits. In a test on Fluid Compute (2 GB,iad1) exporting 11 spans per request, one request at a time, the flush added about 24 ms of billed instance time to an endpoint in the same region and 73 ms to one that answered in 50 ms. Active CPU rose by about 3 ms. That is roughly $0.25 per 1M invocations for a nearby endpoint and $0.55 for a 50 ms one. With concurrent requests on Fluid Compute, the waits overlap and the cost per request is lower.
- Exporting in
waitUntil(orafter()in Next.js) keeps the delay away from your users, but not from the bill. - Work in
waitUntilshares the function’s timeout. If the function times out, unsent spans are lost. - Vercel traces the export itself: the trace drain carries a
vercel.serverless-runtimespan for every outgoingPOST …/v1/tracescall (2,325 in 20 minutes in the test project).
Example
The lab petclinic-agent uses both:apps/web/instrumentation.ts (@vercel/otel in Next.js) and agent/instrumentation/otlp.ts (eve), next to log, trace and Web Analytics drains.
