Skip to main content

CockroachDB monitoring with Netdata

CockroachDB is the SQL database for building global, scalable cloud services that survive disasters.

This module will monitor one or more CockroachDB databases, depending on your configuration.

Metrics

All metrics have "cockroachdb." prefix.

MetricScopeDimensionsUnits
process_cpu_time_combined_percentageglobalusedpercentage
process_cpu_time_percentageglobaluser, syspercentage
process_cpu_timeglobaluser, sysms
process_memoryglobalrssKiB
process_file_descriptorsglobalopenfd
process_uptimeglobaluptimeseconds
host_disk_bandwidthglobalread, writeKiB
host_disk_operationsglobalreads, writesoperations
host_disk_iops_in_progressglobalin_progressiops
host_network_bandwidthglobalreceived, sentkilobits
host_network_packetsglobalreceived, sentpackets
live_nodesgloballive_nodesnodes
node_liveness_heartbeatsglobalsuccessful, failedheartbeats
total_storage_capacityglobaltotalKiB
storage_capacity_usabilityglobalusable, unusableKiB
storage_usable_capacityglobalavailable, usedKiB
storage_used_capacity_percentageglobaltotal, usablepercentage
sql_connectionsglobalactiveconnections
sql_bandwidthglobalreceived, sentKiB
sql_statements_totalglobalstarted, executedstatements
sql_errorsglobalstatement, transactionerrors
sql_started_ddl_statementsglobalddlstatements
sql_executed_ddl_statementsglobalddlstatements
sql_started_dml_statementsglobalselect, update, delete, insertstatements
sql_executed_dml_statementsglobalselect, update, delete, insertstatements
sql_started_tcl_statementsglobalbegin, commit, rollback, savepoint, savepoint_cockroach_restart, release_savepoint_cockroach_restart, rollback_to_savepoint_cockroach_restartstatements
sql_executed_tcl_statementsglobalbegin, commit, rollback, savepoint, savepoint_cockroach_restart, release_savepoint_cockroach_restart, rollback_to_savepoint_cockroach_restartstatements
sql_active_distributed_queriesglobalactivequeries
sql_distributed_flowsglobalactive, queuedflows
live_bytesglobalapplications, systemKiB
logical_dataglobalkeys, valuesKiB
logical_data_countglobalkeys, valuesnum
kv_transactionsglobalcommitted, fast-path_committed, abortedtransactions
kv_transaction_restartsglobalwrite_too_old, write_too_old_multiple, forwarded_timestamp, possible_reply, async_consensus_failure, read_within_uncertainty_interval, aborted, push_failure, unknownrestarts
rangesglobalrangesranges
ranges_replication_problemglobalunavailable, under_replicated, over_replicatedranges
range_eventsglobalsplit, add, remove, mergeevents
range_snapshot_eventsglobalgenerated, applied_raft_initiated, applied_learner, applied_preemptiveevents
rocksdb_read_amplificationglobalreadsreads/query
rocksdb_table_operationsglobalcompactions, flushesoperations
rocksdb_cache_usageglobalusedKiB
rocksdb_cache_operationsglobalhits, missesoperations
rocksdb_cache_hit_rateglobalhit_ratepercentage
rocksdb_sstablesglobalsstablessstables
replicasglobalreplicasreplicas
replicas_quiescenceglobalquiescent, activereplicas
replicas_leadersgloballeaders, not_leaseholdersreplicas
replicas_leaseholdersgloballeaseholdersleaseholders
queue_processing_failuresglobalgc, replica_gc, replication, split, consistency, raft_log, raft_snapshot, time_series_maintenancefailures
rebalancing_queriesglobalavgqueries/s
rebalancing_writesglobalavgwrites/s
timeseries_samplesglobalwrittensamples
timeseries_write_errorsglobalwriteerrors
timeseries_write_bytesglobalwrittenKiB
slow_requestsglobalacquiring_latches, acquiring_lease, in_raftrequests
code_heap_memory_usageglobalgo, cgoKiB
goroutinesglobalgoroutinesgoroutines
gc_countglobalgcinvokes
gc_pauseglobalpauseus
cgo_callsglobalcgocalls

Configuration

Edit the go.d/cockroachdb.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/cockroachdb.conf

Needs only url to server's _status/vars. Here is an example for 2 servers:

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

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

For all available options please see module configuration file.

Update every

Default update_every is 10 seconds because CockroachDB default sampling interval is 10 seconds, and it is not user configurable. It doesn't make sense to decrease the value.

Troubleshooting

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

Was this page helpful?

Contribute