Skip to main content
Available via: Vercel Trace Drains (Pro and Enterprise plans). This is not a Zespan SDK wrapper, see Send traces from any OTel-instrumented app for how the endpoint works.
Vercel AI Gateway can drain a trace for each request. Create a Trace Drain that points at Zespan and every call through the gateway is stored with model, provider, token counts and, for calls that were retried or fell back, each attempt.

Setup

1

Create a Trace Drain

In Vercel, go to Team Settings → Drains → Add Drain, choose Traces, select the projects, and use a custom endpoint with the URL https://api.zespan.com/v1/traces. Vercel offers JSON or Protobuf; Zespan accepts both. Vercel batches drain payloads up to 1 MB, inside Zespan’s limit.
2

Add the project key as a custom header

Add the header x-api-key: zsp_.... Vercel tests the drain when you create it and expects 200 OK, which Zespan answers.
3

Verify

Send one request through the gateway, then open Settings → Instrumentation → Gateway and OTLP data and press Refresh. See Instrumentation.

What gets captured

Attribute names come from Vercel’s published documentation and can change between versions. Use the Gateway and OTLP data card to see what actually arrives.
Gateway identity metadata is not stored. See AI gateways and Security.

Using the SDK too

With both the Zespan SDK and the gateway reporting the same call, Zespan does not merge the two rows: Vercel puts the provider’s response id on each attempt span, not on the root span, and does not document an inbound traceparent. Set up either the SDK or the drain for a given call, or expect the call to be counted twice. See Using the SDK too.

Next steps