Introduction

CockroachDB is a distributed SQL database built for high availability and scalability. By integrating SQL with a distributed architecture, it ensures resilience and strong data consistency. It is available in two editions: Community and Enterprise.

Typically, Prometheus metrics are exposed at https://<host>:8080/_status/vars.

While it can be used for development purposes, most users operate CockroachDB exclusively in HTTPS mode.

Kubernetes 2.0 ConfigMap

Users should update or append the existing ConfigMap named opsramp-workload-metric-user-config by adding application-specific fields. These fields may include authentication credentials, collection frequency, and other relevant configurations.

apiVersion: v1
kind: ConfigMap
metadata:
  name: opsramp-workload-metric-user-config
  namespace: opsramp-agent
data:
  workloads: |
    cockroach:
    - name: cockroach
      collectionFrequency: 2m
      port: 8080
      scheme: "https"
      userRelabelConfigs:
        - regex: 'kvadmission_flow_controller_elastic_tokens_returned'
          action: include
        - regex: 'sql_misc_count' 
          action: include
      targetPodSelector:
        matchLabels:
          - key: controller-revision-hash
            operator: ==
            value:
              - my-release-cockroachdb-74879bc9cc

Supported Metrics

Supported metrics for this workload as provided by the Kubernetes 2.0 Agent.

MetricDescription
rocksdb_block_cache_usageTracks memory used by the RocksDB block cache
jobs_changefeed_resume_failedCounts failed attempts to resume changefeeds
queue_gc_info_transactionresolvefailedNumber of failed transaction resolution attempts by GC
keycountTotal number of keys in the database
gossip_callbacks_pendingNumber of pending gossip callbacks
changefeed_total_rangesTotal number of ranges being watched by changefeeds
kv_rangefeed_registrationsNumber of active rangefeed registrations
rpc_streams_mux_rangefeed_activeActive multiplexed rangefeed RPC streams
admission_wait_durations_sql_sql_response_sumTotal wait duration for SQL response admission
cloud_write_bytesTotal bytes written to cloud storage
sys_host_net_send_bytesTotal network bytes sent by the host system
sql_update_count_internalNumber of internal SQL update statements executed
queue_replicate_replacedecommissioningreplica_successSuccessful replacements of decommissioned replicas
jobs_new_schema_change_currently_runningNumber of running schema change jobs
kv_rangefeed_mem_sharedMemory usage of shared rangefeed resources
range_snapshots_send_total_in_progressCurrent number of range snapshots being sent
sql_ddl_count_internalNumber of internal DDL statements executed
distsender_rpc_err_errordetailtype_20_Number of DistSender RPC errors of type 20
kv_protectedts_reconciliation_errorsNumber of errors in protected timestamp reconciliation
requests_slow_raftCounts of slow Raft requests
queue_replicate_removereplica_errorErrors encountered while removing replicas
tenant_consumption_read_requestsNumber of read requests made by tenants
log_fluent_sink_write_attemptsAttempts to write to the fluent log sink