Recap.dev 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.
Recap.dev currently supports tracing of Netlify Functions out of the box.
RECAP_DEV_SYNC_ENDPOINT environment variable#
Please refer to the official environment variables documentation entry on Netlify.
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.
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:
Recap.dev 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.