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.
initNestJsTracing function before creating your NestJS app.
You may also pass these options to the
- captureLogs - Enables or disables capture of logs from global console object. Defaults to true.
- disableAutomaticUnitNames - Disables default
environment-injectable.methodNameunit names. Defaults to false.
- ignoreUnnamedUnits - Ignore traces without a unit name. Useful if you want to ignore requests to static assets or only trace particular modules. Defaults to true.
- assignUnitName - Defines a unit name for a trace.
The default strategy creates a unit name using a first injectable method appearing in the chain and an environment.
An example of the unit name generated is
Wrap a NestJS module with
wrapNestJsModule function exported from the
@recap.dev/client to trace it with Recap.Dev.
4. Set the
RECAP_DEV_SYNC_ENDPOINT environment variable to point at your Recap.Dev server's sync endpoint, for example:#
Check the complete source code of an example NestJS project traced with Recap.Dev here.
Click here to learn how to set up the function-level tracing for your application.