Tracing an ExpressJS Application
Recap.dev provides two levels of tracing: 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#
1. Install recap.dev client library#
or
2. Wrap your express application with recap.dev tracing#
Note the captureConsoleLogs() call which will automatically collect console.log logs for your trace.
3. Add tracer.setUnitName calls inside your handlers with appropriate names of your handlers.#
4. Set the RECAP_DEV_SYNC_ENDPOINT environment variable to point at your recap.dev server's sync endpoint, for example:#
Check out an example project here.
Setting up a Function-level Tracing#
Click here to learn how to set up the function-level tracing for your application.