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

Configure the Ruby agent's distributed tracing settings to enable end-to-end request tracking, Infinite Tracing tail-based sampling, and span event collection.

## Distributed Tracing [#distributed-tracing]

**distributed_tracing.enabled**

| TypeBoolean                                           |
| ----------------------------------------------------- |
| Defaulttrue                                           |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_ENABLED |

Distributed tracing lets you see the path that a request takes through your distributed system. Enabling distributed tracing changes the behavior of some New Relic features, so carefully consult the [transition guide](https://docs.newrelic.com/docs/transition-guide-distributed-tracing) before you enable this feature.

**distributed_tracing.sampler.root**

| TypeString                                                 |
| ---------------------------------------------------------- |
| Default"adaptive"                                          |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT |

This setting controls the behavior of transaction sampling for transactions without a remote parent (traces that originate within this instance of the New Relic agent). Available values are `adaptive` (the default), `always_on`, `always_off`, and `trace_id_ratio_based`.

**distributed_tracing.sampler.remote_parent_sampled**

| TypeString                                                                  |
| --------------------------------------------------------------------------- |
| Default"adaptive"                                                           |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_SAMPLED |

This setting controls the behavior of transaction sampling when a remote parent is sampled. Available values are `adaptive` (the default), `always_on`, `always_off`, and `trace_id_ratio_based`.

**distributed_tracing.sampler.remote_parent_not_sampled**

| TypeString                                                                      |
| ------------------------------------------------------------------------------- |
| Default"adaptive"                                                               |
| Environ variableNEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_NOT_SAMPLED |

This setting controls the behavior of transaction sampling when a remote parent is not sampled. Available values are `adaptive` (the default), `always_on`, `always_off`, and `trace_id_ratio_based`.

## Infinite Tracing [#infinite-tracing]

**infinite_tracing.trace_observer.host**

| TypeString                                                     |
| -------------------------------------------------------------- |
| Default""                                                      |
| Environ variableNEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_HOST |

Configures the hostname for the trace observer Host. When configured, enables tail-based sampling by sending all recorded spans to a trace observer for further sampling decisions, irrespective of any usual agent sampling decision.

**infinite_tracing.trace_observer.port**

| TypeInteger                                                    |
| -------------------------------------------------------------- |
| Default443                                                     |
| Environ variableNEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_PORT |

Configures the TCP/IP port for the trace observer Host

**infinite_tracing.batching**

| TypeBoolean                                         |
| --------------------------------------------------- |
| Defaulttrue                                         |
| Environ variableNEW_RELIC_INFINITE_TRACING_BATCHING |

If `true` (the default), data sent to the trace observer is batched instead of sending each span individually.

**infinite_tracing.compression_level**

| TypeSymbol                                                   |
| ------------------------------------------------------------ |
| Default:high                                                 |
| Environ variableNEW_RELIC_INFINITE_TRACING_COMPRESSION_LEVEL |

Configure the compression level for data sent to the trace observer. May be one of: `:none`, `:low`, `:medium`, `:high`. Set the level to `:none` to disable compression.

## Span Events [#span-events]

**span_events.enabled**

| TypeBoolean                                   |
| --------------------------------------------- |
| Defaulttrue                                   |
| Environ variableNEW_RELIC_SPAN_EVENTS_ENABLED |

If `true`, enables span event sampling.

**span_events.queue_size**

| TypeInteger                                      |
| ------------------------------------------------ |
| Default10000                                     |
| Environ variableNEW_RELIC_SPAN_EVENTS_QUEUE_SIZE |

Sets the maximum number of span events to buffer when streaming to the trace observer.

**span_events.max_samples_stored**

| TypeInteger                                              |
| -------------------------------------------------------- |
| Default2000                                              |
| Environ variableNEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED |

Defines the maximum number of span events reported from a single harvest. Any Integer between `1` and `10000` is valid. When configuring the agent for [AI monitoring](https://docs.newrelic.com/docs/ai-monitoring/intro-to-ai-monitoring), set to max value `10000`. This ensures the agent captures the maximum amount of distributed traces.
