Configuring the Node.js agent diagnostics data collector

Support for diagnostics data collection is disabled by default. If you have diagnostic capabilities, you must set and adjust the data collection for specific Node.js applications.

Procedure

  • To modify the data collector settings of a specific application that is running:
    1. Navigate to the KNJ_NPM_LIB_LOCATION/node_modules/ibmapm directory, and open the file plugin_port_conf.json in a text editor.
      Tip: For information about KNJ_NPM_LIB_LOCATION, see the parameter description of KNJ_NPM_LIB_LOCATION
    2. Use the following table for information on modifying the data collector settings:
      Table 1. Data collector settings
      Diagnostic data category Description Property Action
      Minimum time delta for stack trace reporting Specifies the response time threshold for collecting the stack trace of a request or a method call. If the response time of a request or method call exceeds this value, the data collector collects its stack trace. minClockStack Set to a value in milliseconds
      Minimum time delta to report requests Specifies the response time threshold for collecting the method trace of a request instance. If the response time of a request instance exceeds this threshold, the data collector collects its method trace. minClockTrace Set to a value in milliseconds
      Maximum number of events per file Specifies the maximum number of events to be recorded in a .jso file. The .jso file records the diagnostic data for these events. eventsPerFile Set to a maximum number of events value
      Maximum amount of time to report to one file Specifies the maximum amount of time for the .jso file to record diagnostic data fileCommitTime Set to the maximum time in seconds
      Maximum number of files to keep before the oldest ones are deleted Specifies the maximum number of .jso files to be kept before the oldest ones are deleted. maxFiles Set to the maximum number of files
      Request sampling period Specifies the sampling period for requests. sampling Set to the wanted sampling period. The default value is 10. A value of 10 means that the agent collects one of every 10 requests.
  • Optional: Set the SECURITY_OFF environment variable if you want the diagnostics data collector to collect user sensitive information such as cookies, HTTP request contexts, and database requests context. This information is not collected by default.
    Use caution when you are setting this variable because it might cause information to be leaked.
    LinuxFor example, to set this environment variable, issue the following command:
    export SECURITY_OFF=true

Results

The configuration of the diagnostics data collector is changed for the running application that you specified or for all applications.