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