Skip to main content
“Did this start with a deploy?” is often the first question in an incident. Vercel’s drains carry build logs and the deployment ID on every log line, but not the deployment events themselves: when a deployment was created, finished, failed, was canceled or promoted to production, and which commit it came from. Those only come through Vercel webhooks. This page sets up a small forwarder that receives Vercel’s deployment webhooks and writes each event to Bronto as an OpenTelemetry event (a log record with an event name). In Bronto you can then search, chart and alert on deploys next to your logs and traces.

What you get

One event per deployment state change: Each event carries the deployment ID and URL, the target (production or preview), and, when the project is connected to a Git repository, the commit SHA, message, author and branch. Deploys made with the Vercel CLI carry no commit information.

Step 1: Add a forwarder route

Vercel webhooks can’t add custom headers, so they can’t send to Bronto’s ingestion endpoint directly. A route in your app receives them, checks the signature and writes each event with the OpenTelemetry Logs SDK. This one is a Next.js route handler; any HTTP endpoint works.
app/api/vercel-webhook/route.ts
Set OTEL_EXPORTER_OTLP_ENDPOINT to https://ingestion.eu.bronto.io (or https://ingestion.us.bronto.io) and OTEL_EXPORTER_OTLP_HEADERS to x-bronto-api-key=<YOUR_API_KEY> in the project’s environment variables, the same as for OpenTelemetry from code. The versions match the OpenTelemetry JS 2.x packages that @vercel/otel 2 uses.

Step 2: Create the webhook

In the Vercel dashboard, open Team Settings → Webhooks, add https://<your-domain>/api/vercel-webhook as the endpoint, select the five deployment events above, and choose the projects. Or use the REST API:
The response contains the webhook’s secret. Store it as VERCEL_WEBHOOK_SECRET in the project’s environment variables and redeploy. Events for the deployment that adds the forwarder itself may arrive before the route exists; from the next deploy on, all events arrive.

Step 3: Query deploys in Bronto

The events land in the dataset named after service.name (vercel-deployments). OTLP attributes keep a $ prefix in queries: To find errors that came with a deploy, take its deployment ID and search the log drain for deploymentId = 'dpl_…' AND level = 'error'.

Things to know

  • Events can arrive twice. In testing, Vercel delivered deployment.canceled twice for one deployment. Deduplicate on vercel.event.id if you count deploys.
  • deployment.promoted has no target field. Treat promotion as production.
  • Failed builds don’t log at level: error. In testing, their error output arrived in the log drain at level: info with type: stderr; the deployment.error event is the reliable signal.

Example

The lab petclinic-agent has the forwarder at apps/web/app/api/vercel-webhook/route.ts, writing to any OTLP backend through the standard OTEL_EXPORTER_OTLP_* variables.