Enabling Time Travel Debugging (TTD) for Node.js Runtime
TTD (TimeTravel Debugging) is supported by Thundra Node.js agent for Node.js runtime. When TTD (TimeTravel Debugging) is enabled, you can see how your tests and applications behave at every level, giving you in-depth monitoring capabilities along with micro-tracing capability even inside the method by tracing code execution line by line with the snapshots (values) of arguments, local variables and fields. TTD (TimeTravel Debugging) is disabled by default, but can be enabled by configuration (environment variables, etc ...).
Time Travel Debugging (TTD) Panel

Configuration via Environment Variables

To configure TTD (Time Travel Debugging) behavior through environment variables without any code change, the traceLineByLine attribute of the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG environment variable must be configured for the modules/files or methods to be traced line by line.
Environment variable names must be in the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG... format, meaning a name must start with the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG. For example, THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG, THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG1, THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG2, etc ... So multiple definitions can be defined through multiple environment variables starting with THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG environment variable name.
Environment variable values must be in the <module-def>.<method-def>[...] format, The asterisk character (*) in the <module-def> and <method-def> is supported. For example
  • If you want to enable TTD (Time Travel Debugging) for all methods in a module (let say that src/user/service.js) using environment variables, the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG environment variable can be specified as src.user.service.*[traceLineByLine=true].
1
THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG: src.user.service.*[traceLineByLine=true]
Copied!
Here, src.user.service part specifies the file location of your module, and * means line by line tracing for all the methods in this file will be enabled.
  • If you want to debug just one method (for ex. getUser), in a module (let say that src/user/service.js) you can specify its name directly, such as:
1
THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG: src.user.service.getUser[traceLineByLine=true]
Copied!
Here, src.user.service part specifies the file location of your module, and getUser means line by line tracing will be enabled only for the getUser method in this file.
  • If you need to enable TTD (Time Travel Debugging) for all files under a directory (let say that src/user/), you can specify the directory name and owned files by using wildcard, such as:
1
THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG: src.user.*.*[traceLineByLine=true]
Copied!
Here src.user.* part specifies all the files located under src.user directory, and * means line by line tracing for all the methods in these files will be enabled.
  • If you need to enable TTD (Time Travel Debugging) for multiple files in different folders/files, you can specify multiple configurations using the same environment variable key, THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG, as the prefix, such as in the following example:
1
THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG_1: src.user.service.*[traceLineByLine=true]
2
THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG_2: src.product.api.*[traceLineByLine=true]
Copied!
Last modified 15d ago