---
title: RethinkDB
description: Collect status, performance and other metrics from a RethinkDB cluster.
breadcrumbs: Docs > Integrations > RethinkDB
---

# RethinkDB
Supported OS Integration version5.4.0
## Overview{% #overview %}

[RethinkDB](https://rethinkdb.com) is a distributed documented-oriented NoSQL database, with first class support for realtime change feeds.

This check monitors a RethinkDB cluster through the Datadog Agent and collects metrics about performance, data availability, cluster configuration, and more.

**Note**: this integration is compatible with RethinkDB **version 2.3.6 and above**.

**Minimum Agent version:** 7.19.0

## Setup{% #setup %}

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/kubernetes/integrations/) for guidance on applying these instructions.

### Installation{% #installation %}

The RethinkDB check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package. No additional installation is needed on your server.

### Configuration{% #configuration %}

1. If using RethinkDB 2.4+, add a `datadog-agent` user with read-only permissions on the `rethinkdb` database. You can use the following ReQL commands, and see [Permissions and user accounts](https://rethinkdb.com/docs/permissions-and-accounts/) for details:

   ```python
   r.db('rethinkdb').table('users').insert({'id': 'datadog-agent', 'password': '<PASSWORD>'})
   r.db('rethinkdb').grant('datadog-agent', {'read': True})
   ```

**Note**: on RethinkDB 2.3.x, granting permissions on the `rethinkdb` database is not supported. Skip this step and use your [admin account](https://rethinkdb.com/docs/security/#the-admin-account) below instead.

1. Edit the `rethinkdb.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory). See the [sample rethinkdb.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/rethinkdb/datadog_checks/rethinkdb/data/conf.yaml.example) for all available configuration options.

   ```yaml
   init_config:
   
   instances:
     - host: localhost
       port: 28015
       user: "<USER>"
       password: "<PASSWORD>"
   ```

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

**Note**: this integration collects metrics from all servers in the cluster, so you only need a single Agent.

#### Log collection{% #log-collection %}

1. Collecting logs is disabled by default in the Datadog Agent, enable it in your `datadog.yaml` file:

   ```yaml
   logs_enabled: true
   ```

1. Edit this configuration block in your `rethinkdb.d/conf.yaml` file to start collecting your RethinkDB logs:

   ```yaml
   logs:
     - type: file
       path: "<LOG_FILE_PATH>"
       source: rethinkdb
       service: "<SERVICE_NAME>"
   ```

Change the `path` parameter value based on your environment. See the [sample conf.yaml](https://github.com/DataDog/integrations-core/blob/master/rethinkdb/datadog_checks/rethinkdb/data/conf.yaml.example) for all available configuration options.

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

To enable logs for Kubernetes environments, see [Kubernetes Log Collection](https://docs.datadoghq.com/agent/kubernetes/log/).

### Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information) and look for `rethinkdb` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **rethinkdb.config.databases**(gauge)                                                          | Number of databases in the cluster.                                                                                 |
| **rethinkdb.config.secondary\_indexes\_per\_table**(gauge)                                     | Number of secondary indexes in a given table.*Shown as index*                                                       |
| **rethinkdb.config.servers**(gauge)                                                            | Number of connected servers in the cluster.*Shown as node*                                                          |
| **rethinkdb.config.tables\_per\_database**(gauge)                                              | Number of tables in a given database.*Shown as table*                                                               |
| **rethinkdb.current\_issues.critical\_issues**(gauge)                                          | Total number of critical current issues of a given issue_type.                                                      |
| **rethinkdb.current\_issues.issues**(gauge)                                                    | Total number of current issues of a given issue_type.                                                               |
| **rethinkdb.server\_status.network.connected\_to**(gauge)                                      | Number of other RethinkDB servers a server is currently connected to.*Shown as node*                                |
| **rethinkdb.server\_status.network.time\_connected**(gauge)                                    | Current total time a server has been connected to the network.*Shown as second*                                     |
| **rethinkdb.server\_status.process.time\_started**(gauge)                                      | Time when the RethinkDB server process started.*Shown as second*                                                    |
| **rethinkdb.stats.cluster.query\_engine.queries\_per\_sec**(gauge)                             | Number of queries executed in a cluster per second.*Shown as query*                                                 |
| **rethinkdb.stats.cluster.query\_engine.read\_docs\_per\_sec**(gauge)                          | Number of documents read in a cluster per second.*Shown as document*                                                |
| **rethinkdb.stats.cluster.query\_engine.written\_docs\_per\_sec**(gauge)                       | Number of documents written in a cluster per second.*Shown as document*                                             |
| **rethinkdb.stats.server.query\_engine.client\_connections**(gauge)                            | Current total number of connections to a server.*Shown as connection*                                               |
| **rethinkdb.stats.server.query\_engine.clients\_active**(gauge)                                | Current number of individual clients connected to a server (a client may hold multiple connections).*Shown as host* |
| **rethinkdb.stats.server.query\_engine.queries\_per\_sec**(gauge)                              | Number of queries executed on a server per second.*Shown as query*                                                  |
| **rethinkdb.stats.server.query\_engine.queries\_total**(count)                                 | Total number of queries executed on a server.*Shown as query*                                                       |
| **rethinkdb.stats.server.query\_engine.read\_docs\_per\_sec**(gauge)                           | Number of documents read from a server per second.*Shown as document*                                               |
| **rethinkdb.stats.server.query\_engine.read\_docs\_total**(count)                              | Total number of documents read from a server.*Shown as document*                                                    |
| **rethinkdb.stats.server.query\_engine.written\_docs\_per\_sec**(gauge)                        | Number of documents written to a server per second.*Shown as document*                                              |
| **rethinkdb.stats.server.query\_engine.written\_docs\_total**(count)                           | Total number of documents written to a server.*Shown as document*                                                   |
| **rethinkdb.stats.table.query\_engine.read\_docs\_per\_sec**(gauge)                            | Number of documents read from a table per second.*Shown as document*                                                |
| **rethinkdb.stats.table.query\_engine.written\_docs\_per\_sec**(gauge)                         | Number of documents written to a table per second.*Shown as document*                                               |
| **rethinkdb.stats.table\_server.query\_engine.read\_docs\_per\_sec**(gauge)                    | Number of documents read from a replica per second.*Shown as document*                                              |
| **rethinkdb.stats.table\_server.query\_engine.read\_docs\_total**(count)                       | Total number of documents read from a replica.*Shown as document*                                                   |
| **rethinkdb.stats.table\_server.query\_engine.written\_docs\_per\_sec**(gauge)                 | Number of documents written to a replica per second.*Shown as document*                                             |
| **rethinkdb.stats.table\_server.query\_engine.written\_docs\_total**(count)                    | Total number of documents written to a replica.*Shown as document*                                                  |
| **rethinkdb.stats.table\_server.storage\_engine.cache.in\_use\_bytes**(gauge)                  | Current amount of memory used by the cache on a replica.*Shown as byte*                                             |
| **rethinkdb.stats.table\_server.storage\_engine.disk.read\_bytes\_per\_sec**(gauge)            | Number of bytes read from the disk of a replica per second.*Shown as byte*                                          |
| **rethinkdb.stats.table\_server.storage\_engine.disk.read\_bytes\_total**(count)               | Total number of bytes read from the disk of a replica.*Shown as byte*                                               |
| **rethinkdb.stats.table\_server.storage\_engine.disk.space\_usage.data\_bytes**(gauge)         | Current disk space used by data on a replica.*Shown as byte*                                                        |
| **rethinkdb.stats.table\_server.storage\_engine.disk.space\_usage.garbage\_bytes**(gauge)      | Current disk space used by the garbage collector on a replica.*Shown as byte*                                       |
| **rethinkdb.stats.table\_server.storage\_engine.disk.space\_usage.metadata\_bytes**(gauge)     | Current disk space used by metadata on a replica.*Shown as byte*                                                    |
| **rethinkdb.stats.table\_server.storage\_engine.disk.space\_usage.preallocated\_bytes**(gauge) | Current disk space preallocated on a replica.*Shown as byte*                                                        |
| **rethinkdb.stats.table\_server.storage\_engine.disk.written\_bytes\_per\_sec**(gauge)         | Number of bytes written to the disk of a replica per second.*Shown as byte*                                         |
| **rethinkdb.stats.table\_server.storage\_engine.disk.written\_bytes\_total**(count)            | Total number of bytes written to the disk of a replica.*Shown as byte*                                              |
| **rethinkdb.system\_jobs.jobs**(gauge)                                                         | Total number of currently running system jobs, tagged by `job_type`.*Shown as job*                                  |
| **rethinkdb.table\_status.shards**(gauge)                                                      | Total number of shards for a table.*Shown as shard*                                                                 |
| **rethinkdb.table\_status.shards.primary\_replicas**(gauge)                                    | Total number of primary replicas for a table shard.*Shown as node*                                                  |
| **rethinkdb.table\_status.shards.replicas**(gauge)                                             | Total number of replicas for a table shard.*Shown as node*                                                          |

### Events{% #events %}

RethinkDB does not include any events.

### Service Checks{% #service-checks %}

**rethinkdb.can\_connect**

Returns `CRITICAL` if the Agent is unable to reach the configured RethinkDB server, `OK` otherwise.

*Statuses: ok, critical*

**rethinkdb.table\_status.status.ready\_for\_outdated\_reads**

Returns `OK` if all shards of a table are ready to accept outdated read queries, `WARNING` otherwise.

*Statuses: ok, warning*

**rethinkdb.table\_status.status.ready\_for\_reads**

Returns `OK` if all shards of a table are ready to accept read queries, `WARNING` otherwise.

*Statuses: ok, warning*

**rethinkdb.table\_status.status.ready\_for\_writes**

Returns `OK` if all shards of a table are ready to accept write queries, `WARNING` otherwise.

*Statuses: ok, warning*

**rethinkdb.table\_status.status.all\_replicas\_ready**

Returns `OK` if all replicas are ready for reads and writes, `WARNING` otherwise (e.g. if backfills are in progress).

*Statuses: ok, warning*

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
