---
title: Setup Data Streams Monitoring for Ruby
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Data Streams Monitoring > Setup Data Streams Monitoring > Setup Data
  Streams Monitoring for Ruby
---

# Setup Data Streams Monitoring for Ruby

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ().
{% /alert %}

{% /callout %}

### Prerequisites{% #prerequisites %}

- [Datadog Agent v7.34.0 or later](https://docs.datadoghq.com/agent.md)

### Supported libraries{% #supported-libraries %}

| Technology | Library                                             | Minimum library version | Minimal tracer version | Recommended tracer version |
| ---------- | --------------------------------------------------- | ----------------------- | ---------------------- | -------------------------- |
| Kafka      | [ruby-kafka](https://github.com/zendesk/ruby-kafka) | 0.7.10                  | 2.23.0                 | 2.23.0 or later            |
| Kafka      | [karafka](https://karafka.io/docs/)                 | 2.3.0                   | 2.23.0                 | 2.23.0 or later            |
| Kafka      | [waterdrop](https://karafka.io/docs/#waterdrop)     | 2.8.8                   | 2.23.0                 | 2.23.0 or later            |

### Installation{% #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:

```yaml
environment:
  - DD_DATA_STREAMS_ENABLED: "true"
  - DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED: "true"
```

### Monitoring Kafka Pipelines{% #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{% #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](https://docs.datadoghq.com/data_streams/manual_instrumentation.md?tab=ruby).

## Further reading{% #further-reading %}

- [Kafka Integration](https://docs.datadoghq.com/integrations/kafka.md)
- [Software Catalog](https://docs.datadoghq.com/tracing/software_catalog.md)
