This page covers the Node.js agent settings for transaction tracing, including trace thresholds, SQL recording modes, slow query collection, and datastore instance reporting.
This section defines the Node.js agent variables in the order they typically appear in the transaction_tracer: { section of your app's newrelic.js configuration file.
Important
Do not use brackets [suffix] at the end of your transaction name. New Relic automatically strips brackets from the name. Instead, use parentheses (suffix) or other symbols if needed.
This option affects both slow queries and record_sql for transaction traces. It can have these values: off, obfuscated, or raw.
When set to off no slow queries will be captured, and backtraces and SQL will not be included in transaction traces. If set to raw or obfuscated, the agent sends raw or obfuscated SQL and a slow query sample to the collector. The agent may also send SQL when other criteria are met, such as when slow_sql.enabled is set.
Transactions are named based on the request, and top_n refers to the "top n slowest transactions" grouped by these names. The module replaces a recorded trace with a new trace only if the new trace is slower than the previous slowest trace of that name. The default value for this setting is top_n: 20, because the Transactions page also defaults to the 20 slowest transactions.
The Node.js agent captures at least five different slow transactions in the first harvest cycle after start up. It will also reset and capture different transactions if no slow transactions have been captured for the last five harvest cycles. This allows you to see more information about more of your app's request paths, at the possible cost of not focusing on the absolutely slowest request for that harvest cycle.
Conseil
To record the absolute slowest transaction over the last minute, you can set top_n: 0 or top_n: 1. However, this causes one very slow route to dominate your transaction traces.
Sets the time, in seconds, for a transaction trace to be considered slow. The default value is apdex_f; this sets the trace threshold to four times your application's Apdex T. If a number is provided, it is set in seconds.
The default apdex_t is 500 milliseconds. If your transaction threshold is set to apdex_f, a "slow" transaction is 2 seconds.
Prefix of attributes to include in transaction traces. Allows * as wildcard at end.
Slow queries variables
This section defines the Node.js agent variables in the order they typically appear in the slow_sql: { section of your app's newrelic.js configuration file. These options control behavior for slow queries, but do not affect SQL nodes in transaction traces.
Defines the maximum number of slow queries the agent collects per minute. The agent discards additional queries after the limit is reached.
Important
Increasing this limit increases memory usage.
Datastore tracer variables
This section defines the Node.js agent variables in the order they typically appear in the datastore_tracer section of your app's newrelic.js configuration file. These options control behavior for collecting datastore instance metrics.
When enabled, the agent collects datastore instance metrics (such as host and port) for some database drivers. These are reported on slow query traces and transaction traces.