Skip to main content

CockroachDB

Plugin: go.d.plugin Module: cockroachdb

Overview

This collector monitors CockroachDB servers.

This collector is supported on all platforms.

This collector supports collecting metrics from multiple instances of this integration, including remote instances.

Default Behavior

Auto-Detection

This integration doesn't support auto-detection.

Limits

The default configuration for this integration does not impose any limits on data collection.

Performance Impact

The default configuration for this integration is not expected to impose a significant performance impact on the system.

Metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

Per CockroachDB instance

These metrics refer to the entire monitored application.

This scope has no labels.

Metrics:

MetricDimensionsUnit
cockroachdb.process_cpu_time_combined_percentageusedpercentage
cockroachdb.process_cpu_time_percentageuser, syspercentage
cockroachdb.process_cpu_timeuser, sysms
cockroachdb.process_memoryrssKiB
cockroachdb.process_file_descriptorsopenfd
cockroachdb.process_uptimeuptimeseconds
cockroachdb.host_disk_bandwidthread, writeKiB
cockroachdb.host_disk_operationsreads, writesoperations
cockroachdb.host_disk_iops_in_progressin_progressiops
cockroachdb.host_network_bandwidthreceived, sentkilobits
cockroachdb.host_network_packetsreceived, sentpackets
cockroachdb.live_nodeslive_nodesnodes
cockroachdb.node_liveness_heartbeatssuccessful, failedheartbeats
cockroachdb.total_storage_capacitytotalKiB
cockroachdb.storage_capacity_usabilityusable, unusableKiB
cockroachdb.storage_usable_capacityavailable, usedKiB
cockroachdb.storage_used_capacity_percentagetotal, usablepercentage
cockroachdb.sql_connectionsactiveconnections
cockroachdb.sql_bandwidthreceived, sentKiB
cockroachdb.sql_statements_totalstarted, executedstatements
cockroachdb.sql_errorsstatement, transactionerrors
cockroachdb.sql_started_ddl_statementsddlstatements
cockroachdb.sql_executed_ddl_statementsddlstatements
cockroachdb.sql_started_dml_statementsselect, update, delete, insertstatements
cockroachdb.sql_executed_dml_statementsselect, update, delete, insertstatements
cockroachdb.sql_started_tcl_statementsbegin, commit, rollback, savepoint, savepoint_cockroach_restart, release_savepoint_cockroach_restart, rollback_to_savepoint_cockroach_restartstatements
cockroachdb.sql_executed_tcl_statementsbegin, commit, rollback, savepoint, savepoint_cockroach_restart, release_savepoint_cockroach_restart, rollback_to_savepoint_cockroach_restartstatements
cockroachdb.sql_active_distributed_queriesactivequeries
cockroachdb.sql_distributed_flowsactive, queuedflows
cockroachdb.live_bytesapplications, systemKiB
cockroachdb.logical_datakeys, valuesKiB
cockroachdb.logical_data_countkeys, valuesnum
cockroachdb.kv_transactionscommitted, fast-path_committed, abortedtransactions
cockroachdb.kv_transaction_restartswrite_too_old, write_too_old_multiple, forwarded_timestamp, possible_reply, async_consensus_failure, read_within_uncertainty_interval, aborted, push_failure, unknownrestarts
cockroachdb.rangesrangesranges
cockroachdb.ranges_replication_problemunavailable, under_replicated, over_replicatedranges
cockroachdb.range_eventssplit, add, remove, mergeevents
cockroachdb.range_snapshot_eventsgenerated, applied_raft_initiated, applied_learner, applied_preemptiveevents
cockroachdb.rocksdb_read_amplificationreadsreads/query
cockroachdb.rocksdb_table_operationscompactions, flushesoperations
cockroachdb.rocksdb_cache_usageusedKiB
cockroachdb.rocksdb_cache_operationshits, missesoperations
cockroachdb.rocksdb_cache_hit_ratehit_ratepercentage
cockroachdb.rocksdb_sstablessstablessstables
cockroachdb.replicasreplicasreplicas
cockroachdb.replicas_quiescencequiescent, activereplicas
cockroachdb.replicas_leadersleaders, not_leaseholdersreplicas
cockroachdb.replicas_leaseholdersleaseholdersleaseholders
cockroachdb.queue_processing_failuresgc, replica_gc, replication, split, consistency, raft_log, raft_snapshot, time_series_maintenancefailures
cockroachdb.rebalancing_queriesavgqueries/s
cockroachdb.rebalancing_writesavgwrites/s
cockroachdb.timeseries_sampleswrittensamples
cockroachdb.timeseries_write_errorswriteerrors
cockroachdb.timeseries_write_byteswrittenKiB
cockroachdb.slow_requestsacquiring_latches, acquiring_lease, in_raftrequests
cockroachdb.code_heap_memory_usagego, cgoKiB
cockroachdb.goroutinesgoroutinesgoroutines
cockroachdb.gc_countgcinvokes
cockroachdb.gc_pausepauseus
cockroachdb.cgo_callscgocalls

Alerts

The following alerts are available:

Alert nameOn metricDescription
cockroachdb_used_storage_capacity cockroachdb.storage_used_capacity_percentagestorage capacity utilization
cockroachdb_used_usable_storage_capacity cockroachdb.storage_used_capacity_percentagestorage usable space utilization
cockroachdb_unavailable_ranges cockroachdb.ranges_replication_problemnumber of ranges with fewer live replicas than needed for quorum
cockroachdb_underreplicated_ranges cockroachdb.ranges_replication_problemnumber of ranges with fewer live replicas than the replication target
cockroachdb_open_file_descriptors_limit cockroachdb.process_file_descriptorsopen file descriptors utilization (against softlimit)

Setup

Prerequisites

No action required.

Configuration

File

The configuration file name for this integration is go.d/cockroachdb.conf.

You can edit the configuration file using the edit-config script from the Netdata config directory.

cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/cockroachdb.conf

Options

The following options can be defined globally: update_every, autodetection_retry.

Config options
NameDescriptionDefaultRequired
update_everyData collection frequency.10no
autodetection_retryRecheck interval in seconds. Zero means no recheck will be scheduled.0no
urlServer URL.http://127.0.0.1:8080/_status/varsyes
timeoutHTTP request timeout.1no
usernameUsername for basic HTTP authentication.no
passwordPassword for basic HTTP authentication.no
proxy_urlProxy URL.no
proxy_usernameUsername for proxy basic HTTP authentication.no
proxy_passwordPassword for proxy basic HTTP authentication.no
methodHTTP request method.GETno
bodyHTTP request body.no
headersHTTP request headers.no
not_follow_redirectsRedirect handling policy. Controls whether the client follows redirects.nono
tls_skip_verifyServer certificate chain and hostname validation policy. Controls whether the client performs this check.nono
tls_caCertification authority that the client uses when verifying the server's certificates.no
tls_certClient TLS certificate.no
tls_keyClient TLS key.no

Examples

Basic

An example configuration.

Config
jobs:
- name: local
url: http://127.0.0.1:8080/_status/vars

HTTP authentication

Local server with basic HTTP authentication.

Config
jobs:
- name: local
url: http://127.0.0.1:8080/_status/vars
username: username
password: password

HTTPS with self-signed certificate

CockroachDB with enabled HTTPS and self-signed certificate.

Config
jobs:
- name: local
url: https://127.0.0.1:8080/_status/vars
tls_skip_verify: yes

Multi-instance

Note: When you define multiple jobs, their names must be unique.

Collecting metrics from local and remote instances.

Config
jobs:
- name: local
url: http://127.0.0.1:8080/_status/vars

- name: remote
url: http://203.0.113.10:8080/_status/vars

Troubleshooting

Debug Mode

To troubleshoot issues with the cockroachdb collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
  • Switch to the netdata user.

    sudo -u netdata -s
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m cockroachdb

Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.