Set the transaction tracer options in the transaction_tracer section. These options can be overridden with a newrelic.config.transaction_tracer prefixed system property.
Transaction tracing captures deep information about slow transactions and sends this to the New Relic service. The transaction includes the exact call sequence of the transactions, including any query statements issued.
重要
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.
Type
Boolean
Default
true
The transaction tracer is enabled by default. Set this to false to turn it off.
Threshold in seconds for query execution time below which the slow query and the EXPLAIN plan (if supported) will not be captured. Relevant to slow queries only when record_sql is set to raw or obfuscated. Relevant to EXPLAIN plans only when explain_enabled is set to true.
Type
Boolean
Default
false
For large SQL statements, executing the regular expressions that attempt to parse exec and call statements can take a significant amount of time.
Setting this to true will disable the execution of these complex regular expressions.
This config exists in Java agent version 8.25.0+.
Type
Integer
Default
2000
The character limit for the SQL query string. If you have many slow SQL queries with large chunks of information, this could negatively affect performance or how quickly you see your data in New Relic. Increase the value gradually until you find the right balance of information and performance.
Type
Boolean
Default
false
Set to true to enable logging of queries to the agent log file instead of uploading to New Relic. Queries are logged using the record_sql mode.
Type
String
Default
obfuscated
When the transaction tracer is on, query statements can optionally be recorded. The recorder has three modes:
off: Send no queries.
raw: Send the query statement in its original form.
obfuscated: Strips out numeric and string literals.
Type
String
Default
(none)
Controls the addition of comments to the beginning of executed SQL statements to be used by the New Relic Query Performance Monitoring
product for entity linking. Default is false.
A resulting comment would resemble this:
/nr_service_guid=MTE3NDc2MDB8QVBNfAAAAAxJQEEEEE9OfDI4MTc5NDEIEA/
Type
Boolean
Default
false
Defaulted to true until Java agent version 3.12.1, when it was changed to false.
This option is for Play 2.x+ only. Play/Scala instrumentation can use Thread.getStackTrace() to improve tracer naming, but at the cost of increased overhead.
Type
Integer
Default
0.5
Defines a threshold (in seconds) for collecting stack traces from an SQL call. When SQL statements exceed this threshold, the agent will capture the current stack trace. This is useful for pinpointing where long SQL calls originate from.
Type
Integer
Default
20
Use this setting to control the variety of your transaction traces. top_n is an integer that represents the number of unique, slow transactions that traces will be created for.
If you want transaction traces to more accurately reflect the actual slowest transactions in your app, make this value lower.
If you want to sample a more diverse array of transactions, make the value higher.
A value of 0 would mean that only the slowest transaction is always traced. This is considered not to be optimal, though, because you may have one or two transactions that are always the slowest, and repeatedly seeing those same transaction traces will probably not give you much value.
If the same transaction is often the slowest, the top_n setting allows the Java agent (over time) to sample the slowest n transactions. This gives you greater variety and more insight into your application.
Type
String (float)
Default
apdex_f
The time threshold used to determine when a transaction is eligible to be traced. When the transaction's response time exceeds this threshold, the transaction becomes eligible for a transaction trace. If sampled, that transaction trace will be recorded and sent to New Relic.
The default is apdex_f (default), which sets the threshold to be the "Frustrated"Apdex level (four times the apdex_t value). You can also set a specific time threshold by entering a float value that represents a number of seconds.
Type
String
Default
(none)
重要
This config has been deprecated as of agent version 5.10.0 and will be removed in a future agent version. Instead use collect_slow_queries_from.
By default, high-security mode does not allow the agent to collect slow queries. Enable this option to collect Cassandra queries from the DataStax driver, even with high security enabled. If you don't use high security, the agent collects slow queries automatically.
For DataStax driver 2.1.2, add this rule to your allow list:
By default, high-security mode does not allow the agent to collect slow queries. Enable this option to collect Cassandra queries from the DataStax driver, even with high security enabled. If you don't use high security, the agent collects slow queries automatically.
For DataStax driver 2.1.2, add this rule to your allow list:
This setting can be used to turn on or off all attributes for transaction traces. If attributes.enabled at the root level is false, no attributes will be sent to transaction traces regardless on how this property (transaction_tracer.attributes.enabled) is set.
Type
List of strings
Default
(none)
If attributes are enabled for transaction traces, all attribute keys found in this list will be sent to New Relic in transaction traces. For more information, see the agent attribute rules.
Type
List of Strings
Default
(none)
All attribute keys found in this list will not be sent to New Relic in transaction traces. For more information, see the agent attribute rules.
Type
Integer
Default
3000
Limits the number of Tokens that can be created per Transaction. Increasing this value may impact performance, because it increases the amount of memory the agent uses and the amount of data sent to New Relic.
Type
Integer
Default
3000
Limits the number of segments that can be created per transaction. Increasing this value may impact performance, because it increases the amount of memory the agent uses and the amount of data sent to New Relic.
Transaction events
Set the transaction events options in the transaction_events section. These options can be overridden with a newrelic.config.transaction_events prefixed system property.
Transaction events data is used to display histograms and percentiles in the UI.
重要
Previously, this section was called analytics_events. If your configuration file still uses analytics_events, update your agent to use transaction_events.
Type
Boolean
Default
true
Enable the transaction events service.
Type
Integer
Default
2000
Max
10000
The maximum number of sampled transaction events reported every 60 seconds.
重要
The minimum number of sample transaction events is 12. Agents with version 5.5.0 or higher send data every 5 seconds. If you set the number of events to less than 12, the number of events sent during the harvest cycle will be insufficient, resulting in no data being sent.
Type
List of maps
Default
(none)
重要
Unlike other settings, custom_request_headers have to be paired together and must be set in the newrelic.yml file. They can't be overwritten by Java virtual machine arguments (system property) or environment variables.
A list of maps with the paired keys header_name and the optional header_alias. Choose one or more custom HTTP request headers to add as transaction attributes.
You can list multiple header configurations:
transaction_events:
custom_request_headers:
-
header_name:"X-Custom-Header-1"
-
header_name:"X-Custom-Header-2"
header_alias:"CustomHeader2alias"
In the first map set, X-Custom-Header-1 is captured and reported by the agent as the header name for a corresponding value from the request object. The header_name will also be the name of the attribute sent to New Relic.
In the second map set, the request header is X-Custom-Header-2, but the CustomHeader2alias is the name sent to New Relic.
Type
Boolean
Default
true
This setting can be used to turn on or off all attributes for transaction events. If attributes.enabled is false at the root level, then no attributes will be sent to transaction events regardless of how this property is set under transaction_events.
Type
List of Strings
Default
(none)
If attributes are enabled for transaction events, all attribute keys found in this list will be sent to New Relic in transaction events. For more information, see the agent attribute rules.
Type
List of Strings
Default
(none)
All attribute keys found in this list will not be sent to New Relic in transaction events. For more information, see the agent attribute rules.
Transaction segments
Set the transaction segments options in the transaction_segments section. These options can be overridden with a newrelic.config.transaction_segments prefixed system property.
Transaction segments represent discrete pieces of work (generally method calls) and are displayed within transaction traces.
This setting can be used to turn on or off all attributes for transaction segments. If attributes.enabled at the root level is false, no attributes will be sent to transaction segments regardless on how this property (transaction_segments.attributes.enabled) is set.
Type
List of strings
Default
(none)
If attributes are enabled for transaction segments, all attribute keys found in this list will be sent to New Relic in transaction segments. For more information, see the agent attribute rules.
Type
List of Strings
Default
(none)
All attribute keys found in this list will not be sent to New Relic in transaction segments. For more information, see the agent attribute rules.
Message tracer
Set message tracer options in the message_tracer section. You can override these settings with a newrelic.config.message_tracer prefixed system property.
Type
Boolean
Default
true
Adds message properties to tracer attributes. Set this to false to turn it off.