Recap.dev 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).
Recap.dev currently provides a wrapper for Vercel Functions out of the box.
wrapVercelHandler provided by the
RECAP_DEV_SYNC_ENDPOINT environment variable#
Please refer to the official environment variables documentation entry on Vercel.
It should point to your recap.dev 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.
A unit is a minimal tracked component in recap.dev. 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: