Trace events#

Stability: 1 - Experimental

The node:trace_events module provides a mechanism to centralize tracing information generated by V8, Node.js core, and userspace code.

Tracing can be enabled with the --trace-event-categories command-line flag or by using the node:trace_events module. The --trace-event-categories flag accepts a list of comma-separated category names.

The available categories are:

  • node: An empty placeholder.
  • node.async_hooks: Enables capture of detailed async_hooks trace data. The async_hooks events have a unique asyncId and a special triggerId triggerAsyncId property.
  • node.bootstrap: Enables capture of Node.js bootstrap milestones.
  • node.console: Enables capture of console.time() and console.count() output.
  • node.threadpoolwork.sync: Enables capture of trace data for threadpool synchronous operations, such as blob, zlib, crypto and node_api.
  • node.threadpoolwork.async: Enables capture of trace data for threadpool asynchronous operations, such as blob, zlib, crypto and node_api.
  • node.dns.native: Enables capture of trace data for DNS queries.
  • node.net.native: Enables capture of trace data for network.
  • node.environment: Enables capture of Node.js Environment milestones.
  • node.fs.sync: Enables capture of trace data for file system sync methods.
  • node.fs_dir.sync: Enables capture of trace data for file system sync directory methods.
  • node.fs.async: Enables capture of trace data for file system async methods.
  • node.fs_dir.async: Enables capture of trace data for file system async directory methods.
  • node.perf: Enables capture of Performance API measurements.
    • node.perf.usertiming: Enables capture of only Performance API User Timing measures and marks.