DDTrace Ruby
Install Dependencies¶
For Ruby APM installation and auto-instrumentation, refer to the Datadog Ruby Integration Documentation.
Configuration¶
Ruby applications usually configure DDTrace either through environment variables or in a Datadog.configure block. For complete configuration details, refer to the Datadog Ruby Tracing Documentation.
When using DataKit as the trace receiver, make sure the trace target points to DataKit instead of the default Datadog Agent endpoint. For example:
If you do not need tracer telemetry data, you can disable it to reduce extra diagnostic reporting:
Environment Variable Support¶
Below are common Ruby APM parameters. For a complete list, refer to the Datadog Ruby configuration documentation.
-
DD_AGENT_HOSTDefault:
127.0.0.1The host address where DataKit is listening.
-
DD_TRACE_AGENT_PORTDefault:
8126The port number where trace data is sent. When using DataKit, set it to
9529. -
DD_ENVDefault:
nilSets the environment for the application, such as
productionorstaging. -
DD_SERVICEDefault: Ruby filename
Sets the default service name for the application.
-
DD_TAGSDefault:
nilSets custom tags on all traces, for example:
team:core,layer:api. -
DD_VERSIONDefault:
nilSets the application version.
-
DD_TRACE_ENABLEDDefault:
trueEnables or disables trace sending. When set to
false, instrumentation still runs, but traces are not sent. -
DD_LOGS_INJECTIONDefault:
trueInjects trace correlation information into supported logs. In Rails, this is enabled by default for common loggers.
-
DD_TRACE_SAMPLE_RATEDefault:
nilSets the trace sampling rate from
0.0(0%) to1.0(100%). -
DD_TRACE_RATE_LIMITDefault:
100Sets the maximum number of sampled traces per second.
-
DD_INSTRUMENTATION_TELEMETRY_ENABLEDDefault:
trueEnables or disables telemetry data sent by the tracer.