Tracing Netlify Functions provides two levels of tracing for Netlify functions: basic tracing and function-level tracing

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).

Function-level tracing also adds timings of the individual function calls to the timeline.

Setting up a Basic Tracing# currently supports tracing of Netlify 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#

import { wrapNetlifyHandler } from ''
export const handler = wrapNetlifyHandler(async (event, context) => {
return {
statusCode: 200,
body: "Hello, World"

3. Add RECAP_DEV_SYNC_ENDPOINT environment variable#

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

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.

The default unit name strategy for Netlify Functions is concatenating a site name and the handler URL path. For example:


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 tracer.setUnitName like this:

import { tracer } from ''

Setting up a Function-level Tracing# currently supports function-level tracing of Netlify Functions with a Babel plugin. If you already have babel set up in your project please refer to the generic Babel function-level setup guide.

Please follow this guide if you haven't configured Babel for your Netlify Functions project yet.

1. Install Dev Dependencies and the Recap.Dev Babel Plugin#

yarn add --dev @babel/plugin-transform-runtime @babel/preset-env @babel/runtime


npm i --save-dev @babel/plugin-transform-runtime @babel/preset-env @babel/runtime

2. Create a Minimal .babelrc File in Your Project Root with the Following Content#

"presets": [
"@babel/preset-env", {
"modules": false
"plugins": [
"regenerator": true