---
title: Ruby agent transaction tracer settings
source: https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration-transaction-tracer-settings
---

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 [#transaction-tracer]

The [transaction traces](https://docs.newrelic.com/docs/apm/traces/transaction-traces/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.

**transaction_tracer.enabled**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaulttrue                                          |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_ENABLED |

If `true`, enables collection of [transaction traces](https://docs.newrelic.com/docs/apm/traces/transaction-traces/transaction-traces).

**transaction_tracer.explain_enabled**

| TypeBoolean                                                  |
| ------------------------------------------------------------ |
| Defaulttrue                                                  |
| Environ variableNEW_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`](#slow_sql-explain_enabled) isn't set separately.

**transaction_tracer.explain_threshold**

| TypeFloat                                                      |
| -------------------------------------------------------------- |
| Default0.5                                                     |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_EXPLAIN_THRESHOLD |

Threshold (in seconds) above which the agent will collect explain plans. Relevant only when [`explain_enabled`](#transaction_tracer.explain_enabled) is true.

**transaction_tracer.limit_segments**

| TypeInteger                                                 |
| ----------------------------------------------------------- |
| Default4000                                                 |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_LIMIT_SEGMENTS |

Maximum number of transaction trace nodes to record in a single transaction trace.

**transaction_tracer.record_redis_arguments**

| TypeBoolean                                                         |
| ------------------------------------------------------------------- |
| Defaultfalse                                                        |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_RECORD_REDIS_ARGUMENTS |

If `true`, the agent records Redis command arguments in transaction traces.

**transaction_tracer.record_sql**

| TypeString                                              |
| ------------------------------------------------------- |
| Default"obfuscated"                                     |
| Environ variableNEW_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](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.

**transaction_tracer.stack_trace_threshold**

| TypeFloat                                                          |
| ------------------------------------------------------------------ |
| Default0.5                                                         |
| Environ variableNEW_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.

**transaction_tracer.cap_segment_artifacts**

| TypeBoolean                                                        |
| ------------------------------------------------------------------ |
| Defaultfalse                                                       |
| Environ variableNEW_RELIC_TRANSACTION_TRACER_CAP_SEGMENT_ARTIFACTS |

If `true`, once [`transaction_tracer.limit_segments`](#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.

**transaction_tracer.transaction_threshold**

| TypeFloat                                                          |
| ------------------------------------------------------------------ |
| Default(Dynamic)                                                   |
| Environ variableNEW_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 [#slow-sql]

**slow_sql.enabled**

| TypeBoolean                                |
| ------------------------------------------ |
| Defaulttrue                                |
| Environ variableNEW_RELIC_SLOW_SQL_ENABLED |

If `true`, the agent collects [slow SQL queries](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/viewing-slow-query-details).

**slow_sql.explain_threshold**

| TypeFloat                                            |
| ---------------------------------------------------- |
| Default0.5                                           |
| Environ variableNEW_RELIC_SLOW_SQL_EXPLAIN_THRESHOLD |

Specify a threshold in seconds. The agent collects [slow SQL queries](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/viewing-slow-query-details) and explain plans that exceed this threshold.

**slow_sql.explain_enabled**

| TypeBoolean                                        |
| -------------------------------------------------- |
| Defaulttrue                                        |
| Environ variableNEW_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`](#transaction_tracer-explain_enabled) setting will be applied as the default setting for explain plans in slow SQL as well.

**slow_sql.record_sql**

| TypeString                                    |
| --------------------------------------------- |
| Defaultobfuscated                             |
| Environ variableNEW_RELIC_SLOW_SQL_RECORD_SQL |

Defines an obfuscation level for slow SQL queries. Valid options are `obfuscated`, `raw`, or `none`.

**slow_sql.use_longer_sql_id**

| TypeBoolean                                          |
| ---------------------------------------------------- |
| Defaultfalse                                         |
| Environ variableNEW_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.
