Skip to main content
Datadog is a monitoring and security platform for cloud applications. The integration of your CockroachDB self-hosted cluster with Datadog enables data collection and alerting on selected CockroachDB metrics using the Datadog platform.
This tutorial explores the CockroachDB self-hosted integration with Datadog. For the CockroachDB Cloud integration with Datadog, refer to instead of this page.
The integration of your CockroachDB self-hosted cluster with Datadog is powered by the Datadog Agent, and supported by Datadog directly: In this tutorial, you will enable the CockroachDB integration in Datadog, configure logging and alerting, and visualize data.

Before you begin

Before you can follow the steps presented in this tutorial, you must have:

Step 1. Enable CockroachDB integration

To enable the CockroachDB check for your installed Datadog Agent, navigate to the Integrations page and find CockroachDB in the list of available integrations. Hover over the icon and click + Install. CockroachDB integration for Datadog installation Note that you must restart the Datadog Agent for the change to take effect. CockroachDB will then be listed as an installed integration.

Step 2. Configure Datadog Agent for CockroachDB

Follow the steps in the Datadog documentation to access and edit your cockroachdb.d/conf.yaml file in your Datadog conf.d/ directory. For all available options, see the sample cockroachdb.d/conf.yaml. After making the following changes, restart the Datadog Agent to apply them.

Enable metrics collection

Uncomment the following line in cockroachdb.d/conf.yaml:
This enables metrics collection via our .

Configure security certificates

Uncomment the lines that begin with tls_private_key and tls_ca_cert. These should specify the full file paths to your CA key and certificate, respectively. For example, if you used to , the paths would look something like:

Enable log collection

Optionally enable Datadog to collect by adding the following block to cockroachdb.d/conf.yaml:
The path value specifies the CockroachDB log file and location.
You can configure both the CockroachDB and .
Log collection is disabled by default in the Datadog Agent. Follow the steps in the Datadog documentation to activate log collection.

Step 3. Verify Datadog connection to CockroachDB

To apply your configuration changes, ensure that you have restarted the Datadog Agent. Run the Datadog Agent status subcommand for your platform to verify that the CockroachDB integration is properly connected. Your output should contain a block like this:

Step 4. View CockroachDB dashboards on Datadog

Open your Datadog Dashboard List and click on CockroachDB Overview: CockroachDB Overview dashboard in Datadog Dashboard List This sample dashboard presents metrics on cluster availability, query performance, and resource usage: CockroachDB Overview dashboard for Datadog
If you wish to customize your CockroachDB dashboard, it’s recommended that you clone the default CockroachDB Overview dashboard before adding and removing widgets. If you leave the default dashboard intact, Datadog will update it when new versions of the integration’s dashboard are released.

Step 5. Run a sample workload

To test the dashboard functionality, use to run a sample workload on the cluster. Initialize the workload for MovR, a fictional vehicle-sharing company:
Run the MovR workload for 5 minutes:
The query metrics will appear on the dashboard: CockroachDB Overview dashboard for Datadog with SQL metrics

Step 6. Add monitoring and alerting

Follow the steps in the Datadog documentation to create a new Monitor. Select Threshold Alert as the detection method. You can use this option to configure an alert that is sent when a supported metric reaches a given threshold. For descriptions of some useful CockroachDB alerts, see . The example alert below will trigger when : CockroachDB Threshold Alert in Datadog
  • cockroachdb.capacity.available is divided by cockroachdb.capacity.total to determine the fraction of available capacity on the node’s (the directory on each node where CockroachDB reads and writes its data).
  • The alert threshold is set to 0.15.
The timeseries graph at the top of the page indicates the configured metric and threshold: CockroachDB Threshold Alert in Datadog

Known limitations

  • The integration of your CockroachDB self-hosted cluster with Datadog only supports displaying cluster-wide averages of reported metrics. Filtering by a specific node is unsupported.

See also