plugin_name: go.d.plugin
modules:
  - meta:
      id: collector-go.d.plugin-cockroachdb
      plugin_name: go.d.plugin
      module_name: cockroachdb
      monitored_instance:
        name: CockroachDB
        link: https://www.cockroachlabs.com/
        icon_filename: cockroachdb.svg
        categories:
          - data-collection.database-servers
      keywords:
        - cockroachdb
        - databases
      related_resources:
        integrations:
          list: []
      info_provided_to_referring_integrations:
        description: ""
      most_popular: false
    overview:
      data_collection:
        metrics_description: |
          This collector monitors CockroachDB servers.
        method_description: ""
      supported_platforms:
        include: []
        exclude: []
      multi_instance: true
      additional_permissions:
        description: ""
      default_behavior:
        auto_detection:
          description: ""
        limits:
          description: ""
        performance_impact:
          description: ""
    setup:
      prerequisites:
        list: []
      configuration:
        file:
          name: go.d/cockroachdb.conf
        options:
          description: |
            The following options can be defined globally: update_every, autodetection_retry.
          folding:
            title: Config options
            enabled: true
          list:
            - name: update_every
              description: Data collection frequency.
              default_value: 10
              required: false
            - name: autodetection_retry
              description: Recheck interval in seconds. Zero means no recheck will be scheduled.
              default_value: 0
              required: false
            - name: url
              description: Server URL.
              default_value: http://127.0.0.1:8080/_status/vars
              required: true
            - name: timeout
              description: HTTP request timeout.
              default_value: 1
              required: false
            - name: username
              description: Username for basic HTTP authentication.
              default_value: ""
              required: false
            - name: password
              description: Password for basic HTTP authentication.
              default_value: ""
              required: false
            - name: proxy_url
              description: Proxy URL.
              default_value: ""
              required: false
            - name: proxy_username
              description: Username for proxy basic HTTP authentication.
              default_value: ""
              required: false
            - name: proxy_password
              description: Password for proxy basic HTTP authentication.
              default_value: ""
              required: false
            - name: method
              description: HTTP request method.
              default_value: GET
              required: false
            - name: body
              description: HTTP request body.
              default_value: ""
              required: false
            - name: headers
              description: HTTP request headers.
              default_value: ""
              required: false
            - name: not_follow_redirects
              description: Redirect handling policy. Controls whether the client follows redirects.
              default_value: false
              required: false
            - name: tls_skip_verify
              description: Server certificate chain and hostname validation policy. Controls whether the client performs this check.
              default_value: false
              required: false
            - name: tls_ca
              description: Certification authority that the client uses when verifying the server's certificates.
              default_value: ""
              required: false
            - name: tls_cert
              description: Client TLS certificate.
              default_value: ""
              required: false
            - name: tls_key
              description: Client TLS key.
              default_value: ""
              required: false
        examples:
          folding:
            title: Config
            enabled: true
          list:
            - name: Basic
              description: An example configuration.
              config: |
                jobs:
                  - name: local
                    url: http://127.0.0.1:8080/_status/vars
            - name: HTTP authentication
              description: Local server with basic HTTP authentication.
              config: |
                jobs:
                  - name: local
                    url: http://127.0.0.1:8080/_status/vars
                    username: username
                    password: password
            - name: HTTPS with self-signed certificate
              description: 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
            - name: Multi-instance
              description: |
                > **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:
      problems:
        list: []
    alerts:
      - name: cockroachdb_used_storage_capacity
        metric: cockroachdb.storage_used_capacity_percentage
        info: storage capacity utilization
        link: https://github.com/netdata/netdata/blob/master/src/health/health.d/cockroachdb.conf
      - name: cockroachdb_used_usable_storage_capacity
        metric: cockroachdb.storage_used_capacity_percentage
        info: storage usable space utilization
        link: https://github.com/netdata/netdata/blob/master/src/health/health.d/cockroachdb.conf
      - name: cockroachdb_unavailable_ranges
        metric: cockroachdb.ranges_replication_problem
        info: number of ranges with fewer live replicas than needed for quorum
        link: https://github.com/netdata/netdata/blob/master/src/health/health.d/cockroachdb.conf
      - name: cockroachdb_underreplicated_ranges
        metric: cockroachdb.ranges_replication_problem
        info: number of ranges with fewer live replicas than the replication target
        link: https://github.com/netdata/netdata/blob/master/src/health/health.d/cockroachdb.conf
      - name: cockroachdb_open_file_descriptors_limit
        metric: cockroachdb.process_file_descriptors
        info: "open file descriptors utilization (against softlimit)"
        link: https://github.com/netdata/netdata/blob/master/src/health/health.d/cockroachdb.conf
    metrics:
      folding:
        title: Metrics
        enabled: false
      description: ""
      availability: []
      scopes:
        - name: global
          description: These metrics refer to the entire monitored application.
          labels: []
          metrics:
            - name: cockroachdb.process_cpu_time_combined_percentage
              description: Combined CPU Time Percentage, Normalized 0-1 by Number of Cores
              unit: percentage
              chart_type: line
              dimensions:
                - name: used
            - name: cockroachdb.process_cpu_time_percentage
              description: CPU Time Percentage
              unit: percentage
              chart_type: stacked
              dimensions:
                - name: user
                - name: sys
            - name: cockroachdb.process_cpu_time
              description: CPU Time
              unit: ms
              chart_type: stacked
              dimensions:
                - name: user
                - name: sys
            - name: cockroachdb.process_memory
              description: Memory Usage
              unit: KiB
              chart_type: line
              dimensions:
                - name: rss
            - name: cockroachdb.process_file_descriptors
              description: File Descriptors
              unit: fd
              chart_type: line
              dimensions:
                - name: open
            - name: cockroachdb.process_uptime
              description: Uptime
              unit: seconds
              chart_type: line
              dimensions:
                - name: uptime
            - name: cockroachdb.host_disk_bandwidth
              description: Host Disk Cumulative Bandwidth
              unit: KiB
              chart_type: area
              dimensions:
                - name: read
                - name: write
            - name: cockroachdb.host_disk_operations
              description: Host Disk Cumulative Operations
              unit: operations
              chart_type: line
              dimensions:
                - name: reads
                - name: writes
            - name: cockroachdb.host_disk_iops_in_progress
              description: Host Disk Cumulative IOPS In Progress
              unit: iops
              chart_type: line
              dimensions:
                - name: in_progress
            - name: cockroachdb.host_network_bandwidth
              description: Host Network Cumulative Bandwidth
              unit: kilobits
              chart_type: area
              dimensions:
                - name: received
                - name: sent
            - name: cockroachdb.host_network_packets
              description: Host Network Cumulative Packets
              unit: packets
              chart_type: line
              dimensions:
                - name: received
                - name: sent
            - name: cockroachdb.live_nodes
              description: Live Nodes in the Cluster
              unit: nodes
              chart_type: line
              dimensions:
                - name: live_nodes
            - name: cockroachdb.node_liveness_heartbeats
              description: Node Liveness Heartbeats
              unit: heartbeats
              chart_type: stacked
              dimensions:
                - name: successful
                - name: failed
            - name: cockroachdb.total_storage_capacity
              description: Total Storage Capacity
              unit: KiB
              chart_type: line
              dimensions:
                - name: total
            - name: cockroachdb.storage_capacity_usability
              description: Storage Capacity Usability
              unit: KiB
              chart_type: stacked
              dimensions:
                - name: usable
                - name: unusable
            - name: cockroachdb.storage_usable_capacity
              description: Storage Usable Capacity
              unit: KiB
              chart_type: stacked
              dimensions:
                - name: available
                - name: used
            - name: cockroachdb.storage_used_capacity_percentage
              description: Storage Used Capacity Utilization
              unit: percentage
              chart_type: line
              dimensions:
                - name: total
                - name: usable
            - name: cockroachdb.sql_connections
              description: Active SQL Connections
              unit: connections
              chart_type: line
              dimensions:
                - name: active
            - name: cockroachdb.sql_bandwidth
              description: SQL Bandwidth
              unit: KiB
              chart_type: area
              dimensions:
                - name: received
                - name: sent
            - name: cockroachdb.sql_statements_total
              description: SQL Statements Total
              unit: statements
              chart_type: area
              dimensions:
                - name: started
                - name: executed
            - name: cockroachdb.sql_errors
              description: SQL Statements and Transaction Errors
              unit: errors
              chart_type: line
              dimensions:
                - name: statement
                - name: transaction
            - name: cockroachdb.sql_started_ddl_statements
              description: SQL Started DDL Statements
              unit: statements
              chart_type: line
              dimensions:
                - name: ddl
            - name: cockroachdb.sql_executed_ddl_statements
              description: SQL Executed DDL Statements
              unit: statements
              chart_type: line
              dimensions:
                - name: ddl
            - name: cockroachdb.sql_started_dml_statements
              description: SQL Started DML Statements
              unit: statements
              chart_type: stacked
              dimensions:
                - name: select
                - name: update
                - name: delete
                - name: insert
            - name: cockroachdb.sql_executed_dml_statements
              description: SQL Executed DML Statements
              unit: statements
              chart_type: stacked
              dimensions:
                - name: select
                - name: update
                - name: delete
                - name: insert
            - name: cockroachdb.sql_started_tcl_statements
              description: SQL Started TCL Statements
              unit: statements
              chart_type: stacked
              dimensions:
                - name: begin
                - name: commit
                - name: rollback
                - name: savepoint
                - name: savepoint_cockroach_restart
                - name: release_savepoint_cockroach_restart
                - name: rollback_to_savepoint_cockroach_restart
            - name: cockroachdb.sql_executed_tcl_statements
              description: SQL Executed TCL Statements
              unit: statements
              chart_type: stacked
              dimensions:
                - name: begin
                - name: commit
                - name: rollback
                - name: savepoint
                - name: savepoint_cockroach_restart
                - name: release_savepoint_cockroach_restart
                - name: rollback_to_savepoint_cockroach_restart
            - name: cockroachdb.sql_active_distributed_queries
              description: Active Distributed SQL Queries
              unit: queries
              chart_type: line
              dimensions:
                - name: active
            - name: cockroachdb.sql_distributed_flows
              description: Distributed SQL Flows
              unit: flows
              chart_type: stacked
              dimensions:
                - name: active
                - name: queued
            - name: cockroachdb.live_bytes
              description: Used Live Data
              unit: KiB
              chart_type: line
              dimensions:
                - name: applications
                - name: system
            - name: cockroachdb.logical_data
              description: Logical Data
              unit: KiB
              chart_type: stacked
              dimensions:
                - name: keys
                - name: values
            - name: cockroachdb.logical_data_count
              description: Logical Data Count
              unit: num
              chart_type: stacked
              dimensions:
                - name: keys
                - name: values
            - name: cockroachdb.kv_transactions
              description: KV Transactions
              unit: transactions
              chart_type: area
              dimensions:
                - name: committed
                - name: fast-path_committed
                - name: aborted
            - name: cockroachdb.kv_transaction_restarts
              description: KV Transaction Restarts
              unit: restarts
              chart_type: stacked
              dimensions:
                - name: write_too_old
                - name: write_too_old_multiple
                - name: forwarded_timestamp
                - name: possible_reply
                - name: async_consensus_failure
                - name: read_within_uncertainty_interval
                - name: aborted
                - name: push_failure
                - name: unknown
            - name: cockroachdb.ranges
              description: Ranges
              unit: ranges
              chart_type: line
              dimensions:
                - name: ranges
            - name: cockroachdb.ranges_replication_problem
              description: Ranges Replication Problems
              unit: ranges
              chart_type: stacked
              dimensions:
                - name: unavailable
                - name: under_replicated
                - name: over_replicated
            - name: cockroachdb.range_events
              description: Range Events
              unit: events
              chart_type: stacked
              dimensions:
                - name: split
                - name: add
                - name: remove
                - name: merge
            - name: cockroachdb.range_snapshot_events
              description: Range Snapshot Events
              unit: events
              chart_type: stacked
              dimensions:
                - name: generated
                - name: applied_raft_initiated
                - name: applied_learner
                - name: applied_preemptive
            - name: cockroachdb.rocksdb_read_amplification
              description: RocksDB Read Amplification
              unit: reads/query
              chart_type: line
              dimensions:
                - name: reads
            - name: cockroachdb.rocksdb_table_operations
              description: RocksDB Table Operations
              unit: operations
              chart_type: line
              dimensions:
                - name: compactions
                - name: flushes
            - name: cockroachdb.rocksdb_cache_usage
              description: RocksDB Block Cache Usage
              unit: KiB
              chart_type: area
              dimensions:
                - name: used
            - name: cockroachdb.rocksdb_cache_operations
              description: RocksDB Block Cache Operations
              unit: operations
              chart_type: stacked
              dimensions:
                - name: hits
                - name: misses
            - name: cockroachdb.rocksdb_cache_hit_rate
              description: RocksDB Block Cache Hit Rate
              unit: percentage
              chart_type: area
              dimensions:
                - name: hit_rate
            - name: cockroachdb.rocksdb_sstables
              description: RocksDB SSTables
              unit: sstables
              chart_type: line
              dimensions:
                - name: sstables
            - name: cockroachdb.replicas
              description: Number of Replicas
              unit: replicas
              chart_type: line
              dimensions:
                - name: replicas
            - name: cockroachdb.replicas_quiescence
              description: Replicas Quiescence
              unit: replicas
              chart_type: stacked
              dimensions:
                - name: quiescent
                - name: active
            - name: cockroachdb.replicas_leaders
              description: Number of Raft Leaders
              unit: replicas
              chart_type: area
              dimensions:
                - name: leaders
                - name: not_leaseholders
            - name: cockroachdb.replicas_leaseholders
              description: Number of Leaseholders
              unit: leaseholders
              chart_type: line
              dimensions:
                - name: leaseholders
            - name: cockroachdb.queue_processing_failures
              description: Queues Processing Failures
              unit: failures
              chart_type: stacked
              dimensions:
                - name: gc
                - name: replica_gc
                - name: replication
                - name: split
                - name: consistency
                - name: raft_log
                - name: raft_snapshot
                - name: time_series_maintenance
            - name: cockroachdb.rebalancing_queries
              description: Rebalancing Average Queries
              unit: queries/s
              chart_type: line
              dimensions:
                - name: avg
            - name: cockroachdb.rebalancing_writes
              description: Rebalancing Average Writes
              unit: writes/s
              chart_type: line
              dimensions:
                - name: avg
            - name: cockroachdb.timeseries_samples
              description: Time Series Written Samples
              unit: samples
              chart_type: line
              dimensions:
                - name: written
            - name: cockroachdb.timeseries_write_errors
              description: Time Series Write Errors
              unit: errors
              chart_type: line
              dimensions:
                - name: write
            - name: cockroachdb.timeseries_write_bytes
              description: Time Series Bytes Written
              unit: KiB
              chart_type: line
              dimensions:
                - name: written
            - name: cockroachdb.slow_requests
              description: Slow Requests
              unit: requests
              chart_type: stacked
              dimensions:
                - name: acquiring_latches
                - name: acquiring_lease
                - name: in_raft
            - name: cockroachdb.code_heap_memory_usage
              description: Heap Memory Usage
              unit: KiB
              chart_type: stacked
              dimensions:
                - name: go
                - name: cgo
            - name: cockroachdb.goroutines
              description: Number of Goroutines
              unit: goroutines
              chart_type: line
              dimensions:
                - name: goroutines
            - name: cockroachdb.gc_count
              description: GC Runs
              unit: invokes
              chart_type: line
              dimensions:
                - name: gc
            - name: cockroachdb.gc_pause
              description: GC Pause Time
              unit: us
              chart_type: line
              dimensions:
                - name: pause
            - name: cockroachdb.cgo_calls
              description: Cgo Calls
              unit: calls
              chart_type: line
              dimensions:
                - name: cgo
