Setup Data Streams Monitoring for Ruby
Prerequisites
Supported libraries
| Technology | Library | Minimal tracer version | Recommended tracer version |
|---|
| Kafka | ruby-kafka | 2.23.0 | 2.23.0 or later |
| Kafka | karafka | 2.23.0 | 2.23.0 or later |
Installation
Ruby uses auto-instrumentation to inject and extract additional metadata required by Data Streams Monitoring for measuring end-to-end latencies and the relationship between queues and services. To enable Data Streams Monitoring, set the DD_DATA_STREAMS_ENABLED environment variable to true on services sending messages to (or consuming messages from) Kafka.
For example:
environment:
- DD_DATA_STREAMS_ENABLED: "true"
- DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED: "true"
Monitoring Kafka Pipelines
Data Streams Monitoring uses message headers to propagate context through Kafka streams. If log.message.format.version is set in the Kafka broker configuration, it must be set to 0.11.0.0 or higher. Data Streams Monitoring is not supported for versions lower than this.
Manual instrumentation
Data Streams Monitoring propagates context through message headers. If you are using a message queue technology that is not supported by DSM, a technology without headers (such as Kinesis), use manual instrumentation to set up DSM.
Further reading
Additional helpful documentation, links, and articles: