Skip to content

Latest commit

 

History

History

cockroachdb

Agent Check: CockroachDB

Overview

The CockroachDB check monitors the overall health and performance of a CockroachDB cluster.

Setup

Installation

The CockroachDB check is included in the Datadog Agent package, so you do not need to install anything else on your server.

Starting with version 1.9.0, this OpenMetrics-based integration has a latest mode (enabled by setting openmetrics_endpoint to point to the target endpoint) and a legacy mode (enabled by setting prometheus_url instead). To get all the most up-to-date features, Datadog recommends enabling the latest mode. Note that the latest mode requires Python 3. For more information, see Latest and Legacy Versioning For OpenMetrics-based Integrations.

For hosts unable to use Python 3, or to use legacy mode, see the following configuration.

Configuration

Host

To configure this check for an Agent running on a host:

Metric collection
  1. Edit the cockroachdb.d/conf.yaml file, in the conf.d/ folder at the root of your Agent's configuration directory to start collecting your CockroachDB performance data. For a multi-node cluster, configure a separate check instance for each node. See the sample cockroachdb.d/conf.yaml for all available configuration options.

    init_config:
    
    instances:
        ## @param openmetrics_endpoint - string - required
        ## The URL exposing metrics in the OpenMetrics format.
        #
      - openmetrics_endpoint: http://localhost:8080/_status/vars
  2. Restart the Agent.

Log collection

Available for Agent version 6.0 or later

  1. Collecting logs is disabled by default in the Datadog Agent. Enable it in datadog.yaml:

    logs_enabled: true
  2. Add this configuration block to your cockroachdb.d/conf.yaml file to start collecting your CockroachDB logs:

    logs:
     - type: file
       path: /var/lib/cockroach/logs/cockroach.log
       source: cockroachdb
       service: cockroachdb
       log_processing_rules:
       - type: multi_line
         name: new_log_start_with_status_and_date
         pattern: [A-Z]\d{6}\s\d+\:\d+\:\d+\.\d+

    Change the path and service parameter values and configure them for your environment. See the sample cockroachdb.d/conf.yaml for all available configuration options.

  3. Restart the Agent.

Containerized

For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.

Parameter Value
<INTEGRATION_NAME> cockroachdb
<INIT_CONFIG> blank or {}
<INSTANCE_CONFIG> {"openmetrics_endpoint":"http://%%host%%:8080/_status/vars"}
Log collection

Collecting logs is disabled by default in the Datadog Agent. To enable it, see the Docker Log Collection.

Then, set log integrations as Docker labels:

LABEL "com.datadoghq.ad.logs"='[{"source": "cockroachdb", "service": "<SERVICE_NAME>"}]'

Validation

Run the Agent's status subcommand and look for cockroachdb under the Checks section.

Data Collected

Metrics

See metadata.csv for a list of metrics provided by this integration.

Service Checks

The CockroachDB check does not include any service checks.

Events

The CockroachDB check does not include any events.

Troubleshooting

Need help? Contact Datadog support.

Further Reading

Additional helpful documentation, links, and articles: