Tracing Vercel Serverless Functions currently only provides basic tracing for the Vercel Serverless Functions.

Basic tracing collects request, response and error information, logs, and provides a timeline of external resource access (databases, HTTP endpoints, external services) of your unit (basically, endpoint or handler).

Setting up a Basic Tracing# currently provides a wrapper for Vercel Functions out of the box.

1. Install Recap.Dev Client Library#

yarn add


npm i --save

2. Wrap Your Handler Functions with Recap.Dev Tracing#

Use wrapVercelHandler provided by the package

import { wrapVercelHandler } from ''
import fetch from 'node-fetch'
module.exports = wrapVercelHandler(async (req, res) => {
const response = await fetch('')
const json = await response.json()
}, process.env.VERCEL_ENV + '/api/hello')

3. Add RECAP_DEV_SYNC_ENDPOINT environment variable#

Please refer to the official environment variables documentation entry on Vercel.

It should point to your server installation. For example:


After doing this and redeploying you should start getting tracing data with basic details.

Check out a complete example project here.

Unit Name#

A unit is a minimal tracked component in By configuring unit names, you can select a granularity of your data to your liking.

Unfortunately, there is currently no way of providing a per-endpoint name automatically for Vercel Functions.

The strategy used in the example project is concatenating an environment name and the hardcoded handler URL path. Which will give a unit name like this:


Which will result in a unit being a handler in a specific environment.

You can always modify the name of the unit in the current trace by calling the tracer.setUnitName method like this:

import { tracer } from ''