Configure the Ruby agent's transaction tracer and slow SQL settings to control how traces are collected, what SQL is recorded, and when explain plans are gathered.
Transaction Tracer
The transaction traces feature collects detailed information from a selection of transactions, including a summary of the calling sequence, a breakdown of time spent, and a list of SQL queries and their query plans (on mysql and postgresql). Available features depend on your New Relic subscription level.
| Type | Boolean |
|---|---|
| Default | true |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_ENABLED |
If true, enables collection of transaction traces.
| Type | Boolean |
|---|---|
| Default | true |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_EXPLAIN_ENABLED |
If true, enables the collection of explain plans in transaction traces. This setting will also apply to explain plans in slow SQL traces if slow_sql.explain_enabled isn't set separately.
| Type | Float |
|---|---|
| Default | 0.5 |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_EXPLAIN_THRESHOLD |
Threshold (in seconds) above which the agent will collect explain plans. Relevant only when explain_enabled is true.
| Type | Integer |
|---|---|
| Default | 4000 |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_LIMIT_SEGMENTS |
Maximum number of transaction trace nodes to record in a single transaction trace.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_RECORD_REDIS_ARGUMENTS |
If true, the agent records Redis command arguments in transaction traces.
| Type | String |
|---|---|
| Default | "obfuscated" |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_RECORD_SQL |
Obfuscation level for SQL queries reported in transaction trace nodes. By default, this is set to obfuscated, which strips out the numeric and string literals.
- If you do not want the agent to capture query information, set this to
none. - If you want the agent to capture all query information in its original form, set this to
raw. - When you enable high security mode, this is automatically set to
obfuscated.
| Type | Float |
|---|---|
| Default | 0.5 |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_STACK_TRACE_THRESHOLD |
Specify a threshold in seconds. The agent includes stack traces in transaction trace nodes when the stack trace duration exceeds this threshold.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_CAP_SEGMENT_ARTIFACTS |
If true, once transaction_tracer.limit_segments is reached, the agent will also stop recording exclusive time for any segments created afterward in that transaction. This can reduce memory usage for very long-running transactions with many segments, at the cost of less accurate timing data for segments in the transaction if the segment limit is reached.
| Type | Float |
|---|---|
| Default | (Dynamic) |
| Environ variable | NEW_RELIC_TRANSACTION_TRACER_TRANSACTION_THRESHOLD |
Specify a threshold in seconds. Transactions with a duration longer than this threshold are eligible for transaction traces. Specify a float value or the string apdex_f.
Slow SQL
| Type | Boolean |
|---|---|
| Default | true |
| Environ variable | NEW_RELIC_SLOW_SQL_ENABLED |
If true, the agent collects slow SQL queries.
| Type | Float |
|---|---|
| Default | 0.5 |
| Environ variable | NEW_RELIC_SLOW_SQL_EXPLAIN_THRESHOLD |
Specify a threshold in seconds. The agent collects slow SQL queries and explain plans that exceed this threshold.
| Type | Boolean |
|---|---|
| Default | true |
| Environ variable | NEW_RELIC_SLOW_SQL_EXPLAIN_ENABLED |
If true, the agent collects explain plans in slow SQL queries. If this setting is omitted, the transaction_tracer.explain_enabled setting will be applied as the default setting for explain plans in slow SQL as well.
| Type | String |
|---|---|
| Default | obfuscated |
| Environ variable | NEW_RELIC_SLOW_SQL_RECORD_SQL |
Defines an obfuscation level for slow SQL queries. Valid options are obfuscated, raw, or none.
| Type | Boolean |
|---|---|
| Default | false |
| Environ variable | NEW_RELIC_SLOW_SQL_USE_LONGER_SQL_ID |
If true, the agent generates a longer sql_id for slow SQL traces. sql_id is used for aggregation of similar queries.