zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: 748ad4d098d447d492bb935c907f652f
      name: Templates/Databases
  templates:
    - uuid: 36116d8675da47b8a678193969d5a787
      template: 'CockroachDB by HTTP'
      name: 'CockroachDB by HTTP'
      description: |
        The template to monitor CockroachDB nodes by Zabbix that works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        The template collects metrics by HTTP agent from Prometheus endpoint and health endpoints.
        
        Internal node metrics are collected from Prometheus /_status/vars endpoint.
        Node health metrics are collected from /health and /health?ready=1 endpoints.
        The template doesn't require usage of session token.
        
        Note, that some metrics may not be collected depending on your CockroachDB version and configuration.
        
        Setup:
        
        Set the hostname or IP address of the CockroachDB node host in the '{$COCKROACHDB.API.HOST}' macro. You can also change the port in the '{$COCKROACHDB.API.PORT}' macro and the scheme in the '{$COCKROACHDB.API.SCHEME}' macro if necessary.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      vendor:
        name: Zabbix
        version: 7.0-0
      groups:
        - name: Templates/Databases
      items:
        - uuid: 90f7e9b6d22e4c30990f06f0320056d3
          name: 'CA certificate expiration date'
          type: DEPENDENT
          key: cockroachdb.cert.expire_date.ca
          value_type: FLOAT
          trends: '0'
          units: unixtime
          description: 'CA certificate expires at that date.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - security_certificate_expiration_ca
                - value
                - ''
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: ca-certificate
          triggers:
            - uuid: 76a2093eb0214185ab8e03986f3f1474
              expression: '(last(/CockroachDB by HTTP/cockroachdb.cert.expire_date.ca) - now()) / 86400 < {$COCKROACHDB.CERT.CA.EXPIRY.WARN}'
              name: 'CA certificate expires soon'
              event_name: 'CA certificate expires soon (less than {$COCKROACHDB.CERT.CA.EXPIRY.WARN} days)'
              priority: WARNING
              description: 'CA certificate expires soon.'
              tags:
                - tag: scope
                  value: notice
        - uuid: 0328c188d5954ae48dcc0649c9c01f52
          name: 'Node certificate expiration date'
          type: DEPENDENT
          key: cockroachdb.cert.expire_date.node
          value_type: FLOAT
          trends: '0'
          units: unixtime
          description: 'Node certificate expires at that date.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - security_certificate_expiration_node
                - value
                - ''
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: node-certificate
          triggers:
            - uuid: 592152fe1dde4e81abd4bee76c3dae9d
              expression: '(last(/CockroachDB by HTTP/cockroachdb.cert.expire_date.node) - now()) / 86400 < {$COCKROACHDB.CERT.NODE.EXPIRY.WARN}'
              name: 'Node certificate expires soon'
              event_name: 'Node certificate expires soon (less than {$COCKROACHDB.CERT.NODE.EXPIRY.WARN} days)'
              priority: WARNING
              description: 'Node certificate expires soon.'
              tags:
                - tag: scope
                  value: notice
        - uuid: 156d0c66c25a4938b87bd4527580cfd4
          name: 'Clock offset'
          type: DEPENDENT
          key: cockroachdb.clock.offset
          value_type: FLOAT
          units: s
          description: 'Mean clock offset of the node against the rest of the cluster.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - clock_offset_meannanos
                - value
                - ''
            - type: MULTIPLIER
              parameters:
                - '1.0E-9'
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: bddc5c6ac7294bb4be9ed8a4f4d4f4a9
              expression: 'min(/CockroachDB by HTTP/cockroachdb.clock.offset,5m) > {$COCKROACHDB.CLOCK.OFFSET.MAX.WARN} * 0.001'
              name: 'Clock offset is too high'
              event_name: 'Clock offset is too high (over {$COCKROACHDB.CLOCK.OFFSET.MAX.WARN}ms for 5m)'
              priority: WARNING
              description: 'Cockroach-measured clock offset is nearing limit (by default, servers kill themselves at 400ms from the mean).'
              tags:
                - tag: scope
                  value: health
        - uuid: 7b6ef56741c14222bef3d40af3bb6b44
          name: 'CPU: System time'
          type: DEPENDENT
          key: cockroachdb.cpu.system_time
          value_type: FLOAT
          units: s
          description: 'System CPU time.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_cpu_sys_ns
                - value
                - ''
            - type: CHANGE_PER_SECOND
            - type: MULTIPLIER
              parameters:
                - '1.0E-9'
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: cpu
        - uuid: 42008c218c0b4049a4e94daf40754dd7
          name: 'CPU: User time'
          type: DEPENDENT
          key: cockroachdb.cpu.user_time
          value_type: FLOAT
          units: s
          description: 'User CPU time.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_cpu_user_ns
                - value
                - ''
            - type: CHANGE_PER_SECOND
            - type: MULTIPLIER
              parameters:
                - '1.0E-9'
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: cpu
        - uuid: b13dceebd399415f868c3f1ce68ee46a
          name: 'CPU: Utilization'
          type: DEPENDENT
          key: cockroachdb.cpu.util
          value_type: FLOAT
          units: '%'
          description: 'The CPU utilization expressed in %.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_cpu_combined_percent_normalized
                - value
                - ''
            - type: MULTIPLIER
              parameters:
                - '100'
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: cpu
        - uuid: e186df881d6e40ac966e23341b2dbd36
          name: 'File descriptors: Limit'
          type: DEPENDENT
          key: cockroachdb.descriptors.limit
          value_type: FLOAT
          description: 'Open file descriptors soft limit of the process.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_fd_softlimit
                - value
                - ''
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: storage
        - uuid: e21fd3d697294d0f93b504ba57e7552e
          name: 'File descriptors: Open'
          type: DEPENDENT
          key: cockroachdb.descriptors.open
          value_type: FLOAT
          description: 'The number of open file descriptors.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_fd_open
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: storage
        - uuid: 4525de4ee6994c34af6ea3444295bd58
          name: 'Disk: IOPS in progress, rate'
          type: DEPENDENT
          key: cockroachdb.disk.iops.in_progress.rate
          value_type: FLOAT
          description: 'Number of disk IO operations currently in progress on this host.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_host_disk_iopsinprogress
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: storage
        - uuid: 1240655e000643c98694a5efbb0582d0
          name: 'Disk: Read IOPS, rate'
          type: DEPENDENT
          key: cockroachdb.disk.iops.read.rate
          value_type: FLOAT
          description: 'Number of disk read operations per second across all disks since this process started.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_host_disk_read_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: storage
        - uuid: cfa381c7317d479ea5e24b0a3ac9de6a
          name: 'Disk: Write IOPS, rate'
          type: DEPENDENT
          key: cockroachdb.disk.iops.write.rate
          value_type: FLOAT
          description: 'Disk write operations per second across all disks since this process started.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_host_disk_write_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: storage
        - uuid: e226b55a125d4360b853690dbd0d9b63
          name: 'Disk: Reads, rate'
          type: DEPENDENT
          key: cockroachdb.disk.read.rate
          value_type: FLOAT
          units: Bps
          description: 'Bytes read from all disks per second since this process started'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_host_disk_read_bytes
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: storage
        - uuid: 327d62286a5c40d49690b89b12350c31
          name: 'Disk: Writes, rate'
          type: DEPENDENT
          key: cockroachdb.disk.write.rate
          value_type: FLOAT
          units: Bps
          description: 'Bytes written to all disks per second since this process started.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_host_disk_write_bytes
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: storage
        - uuid: 8092c82f81824a168328a438d85a0a93
          name: 'GC: Pause time'
          type: DEPENDENT
          key: cockroachdb.gc.pause_time
          value_type: FLOAT
          units: s
          description: 'The amount of processor time used by Go''s garbage collector across all nodes. During garbage collection, application code execution is paused.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_gc_pause_ns
                - value
                - ''
            - type: CHANGE_PER_SECOND
            - type: MULTIPLIER
              parameters:
                - '1.0E-9'
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: gc
        - uuid: 72298c0f0a00460e85562d13e3baf4b0
          name: 'GC: Runs, rate'
          type: DEPENDENT
          key: cockroachdb.gc.runs.rate
          value_type: FLOAT
          description: 'The number of times that Go''s garbage collector was invoked per second across all nodes.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_gc_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: gc
        - uuid: a8cd030e869b4d788126ee5fa35d3403
          name: 'Get health'
          type: HTTP_AGENT
          key: cockroachdb.get_health
          description: 'Get node /health endpoint'
          valuemap:
            name: 'Node health'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: REGEX
              parameters:
                - 'HTTP.*\s(\d+)'
                - \1
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          timeout: 15s
          url: '{$COCKROACHDB.API.SCHEME}://{$COCKROACHDB.API.HOST}:{$COCKROACHDB.API.PORT}/health'
          status_codes: '200,500'
          retrieve_mode: HEADERS
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 6ccd74acda004a738c3003af4526cd91
              expression: 'last(/CockroachDB by HTTP/cockroachdb.get_health) = 500'
              name: 'Node is unhealthy'
              priority: AVERAGE
              description: 'Node''s /health endpoint has returned HTTP 500 Internal Server Error which indicates unhealthy mode.'
              dependencies:
                - name: 'Service is down'
                  expression: 'last(/CockroachDB by HTTP/net.tcp.service["{$COCKROACHDB.API.SCHEME}","{$COCKROACHDB.API.HOST}","{$COCKROACHDB.API.PORT}"]) = 0'
              tags:
                - tag: scope
                  value: health
        - uuid: 926415babea74e2f951a0420bbdf1d8d
          name: 'Get metrics'
          type: HTTP_AGENT
          key: cockroachdb.get_metrics
          history: '0'
          value_type: TEXT
          description: 'Get raw metrics from the Prometheus endpoint.'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
          timeout: 15s
          url: '{$COCKROACHDB.API.SCHEME}://{$COCKROACHDB.API.HOST}:{$COCKROACHDB.API.PORT}/_status/vars'
          tags:
            - tag: component
              value: raw
        - uuid: 3e5e18e02b1b4f8d8f17c2e7d993169c
          name: 'Get readiness'
          type: HTTP_AGENT
          key: cockroachdb.get_readiness
          description: 'Get node /health?ready=1 endpoint'
          valuemap:
            name: 'Node readiness'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: REGEX
              parameters:
                - 'HTTP.*\s(\d+)'
                - \1
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          timeout: 15s
          url: '{$COCKROACHDB.API.SCHEME}://{$COCKROACHDB.API.HOST}:{$COCKROACHDB.API.PORT}/health?ready=1'
          status_codes: '200,503'
          retrieve_mode: HEADERS
          tags:
            - tag: component
              value: health
        - uuid: a36bcb9217054c1db2e67c8533842d01
          name: 'Go: Goroutines count'
          type: DEPENDENT
          key: cockroachdb.go.goroutines.count
          value_type: FLOAT
          description: 'Current number of Goroutines. This count should rise and fall based on load.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_goroutines
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: go
        - uuid: 9dcb023ceacb4023897af11b96592d6b
          name: 'Liveness heartbeats, rate'
          type: DEPENDENT
          key: cockroachdb.heartbeaths.success.rate
          description: 'Number of successful node liveness heartbeats per second from this node.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - liveness_heartbeatsuccesses
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: liveness
        - uuid: 1a01d2c75d934f489e171a3a147a2078
          name: 'KV transactions: Aborted, rate'
          type: DEPENDENT
          key: cockroachdb.kv.transactions.aborted.rate
          value_type: FLOAT
          description: 'Number of aborted KV transactions per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - txn_aborts
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: kv
        - uuid: be9c377ac5a64579a3b849bbd28e4dc7
          name: 'KV transactions: Committed, rate'
          type: DEPENDENT
          key: cockroachdb.kv.transactions.committed.rate
          value_type: FLOAT
          description: 'Number of KV transactions (including 1PC) committed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - txn_commits
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: kv
        - uuid: 872eaa89c9e34c358f60b845316a22c0
          name: 'Live nodes count'
          type: DEPENDENT
          key: cockroachdb.live_count
          description: 'The number of live nodes in the cluster (will be 0 if this node is not itself live).'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - liveness_livenodes
                - value
                - ''
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: liveness
        - uuid: 5a8bf48e85b845bf83346491ccf5cfac
          name: 'Memory: Allocated by Cgo'
          type: DEPENDENT
          key: cockroachdb.memory.cgo.allocated
          value_type: FLOAT
          units: B
          description: 'Current bytes of memory allocated by the C layer.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_cgo_allocbytes
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: cgo
            - tag: component
              value: memory
        - uuid: 07dc780b07ee4a34abd9bc658416f507
          name: 'Memory: Managed by Cgo'
          type: DEPENDENT
          key: cockroachdb.memory.cgo.managed
          value_type: FLOAT
          units: B
          description: 'Total bytes of memory managed by the C layer.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_cgo_totalbytes
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: cgo
            - tag: component
              value: memory
        - uuid: af45fdeea2ff4b7ba2d488b704966f16
          name: 'Memory: Allocated by Go'
          type: DEPENDENT
          key: cockroachdb.memory.go.allocated
          value_type: FLOAT
          units: B
          description: 'Current bytes of memory allocated by the Go layer.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_go_allocbytes
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: go
            - tag: component
              value: memory
        - uuid: 74669e09ce86441d877de519c86b3f83
          name: 'Memory: Managed by Go'
          type: DEPENDENT
          key: cockroachdb.memory.go.managed
          value_type: FLOAT
          units: B
          description: 'Total bytes of memory managed by the Go layer.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_go_totalbytes
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: go
            - tag: component
              value: memory
        - uuid: 14524b3f8c5f4d509d15063af19c9569
          name: 'Memory: Allocated by SQL'
          type: DEPENDENT
          key: cockroachdb.memory.sql
          value_type: FLOAT
          units: B
          description: 'Current SQL statement memory usage for root.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_mem_root_current
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: memory
            - tag: component
              value: sql
        - uuid: c10b66dd872145528540e90ad3198b81
          name: 'Memory: Total usage'
          type: DEPENDENT
          key: cockroachdb.memory.total
          value_type: FLOAT
          units: B
          description: 'Resident set size (RSS) of memory in use by the node.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_rss
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: memory
        - uuid: aee505389afb4fb0a4a7d8b8dd58fe76
          name: 'Network: Bytes received, rate'
          type: DEPENDENT
          key: cockroachdb.network.bytes.received.rate
          value_type: FLOAT
          units: Bps
          description: 'Bytes received per second on all network interfaces since this process started.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_host_net_recv_bytes
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: network
        - uuid: 9b04fac1a84e40aa833366fda679a3e3
          name: 'Network: Bytes sent, rate'
          type: DEPENDENT
          key: cockroachdb.network.bytes.sent.rate
          value_type: FLOAT
          units: Bps
          description: 'Bytes sent per second on all network interfaces since this process started.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_host_net_send_bytes
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: network
        - uuid: 717ef9bbc00c46a09b28811910c4163a
          name: 'Slow requests: DistSender RPCs'
          type: DEPENDENT
          key: cockroachdb.slow_requests.rpc
          value_type: FLOAT
          description: 'Number of RPCs stuck or retrying for a long time.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - requests_slow_distsender
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: requests
        - uuid: dafcd171e5eb4a56ac6537cb4ae15071
          name: 'SQL: Bytes received, rate'
          type: DEPENDENT
          key: cockroachdb.sql.bytes.received.rate
          value_type: FLOAT
          units: Bps
          description: 'Total amount of incoming SQL client network traffic in bytes per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_bytesin
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 2795f530365d4f80866926f49a3841df
          name: 'SQL: Bytes sent, rate'
          type: DEPENDENT
          key: cockroachdb.sql.bytes.sent.rate
          value_type: FLOAT
          units: Bps
          description: 'Total amount of outgoing SQL client network traffic in bytes per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_bytesout
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 655018f6a2b7480a883c08ffd8c3c5e7
          name: 'SQL: Schema changes, rate'
          type: DEPENDENT
          key: cockroachdb.sql.schema_changes.rate
          value_type: FLOAT
          description: 'Total number of SQL DDL statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_ddl_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 79ed7dc3660a44cc8f30822e992154b6
          name: 'SQL sessions: Open'
          type: DEPENDENT
          key: cockroachdb.sql.sessions
          value_type: FLOAT
          description: 'Total number of open SQL sessions.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_conns
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: d4164a9763b34976ba8f89a49e9aaf25
          name: 'SQL statements: Active'
          type: DEPENDENT
          key: cockroachdb.sql.statements.active
          value_type: FLOAT
          description: 'Total number of SQL statements currently active.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_distsql_queries_active
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: bcae7af870ed48dc919be3dbd63df1ba
          name: 'SQL statements: Contention, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.contention.rate
          value_type: FLOAT
          description: 'Total number of SQL statements that experienced contention per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_distsql_contended_queries_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 80b08a576e334963a17e37a5c2305214
          name: 'SQL statements: DELETE, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.delete.rate
          value_type: FLOAT
          description: 'A moving average of the number of DELETE statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_delete_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 68532afbcda644f1928203c013335f2a
          name: 'SQL statements: Denials, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.denials.rate
          value_type: FLOAT
          description: 'The number of statements denied per second by a feature flag.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_feature_flag_denial
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: dc93958dabdc439f8a7ad9c5a12fddcd
          name: 'SQL statements: Errors, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.errors.rate
          value_type: FLOAT
          description: 'Total number of statements which returned a planning or runtime error per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_failure_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
          triggers:
            - uuid: 7307fc4f2c29438e99eea0256a8755ce
              expression: 'min(/CockroachDB by HTTP/cockroachdb.sql.statements.errors.rate,5m) > {$COCKROACHDB.STATEMENTS.ERRORS.MAX.WARN}'
              name: 'SQL statements errors rate is too high'
              event_name: 'SQL statements errors rate is too high (over {$COCKROACHDB.STATEMENTS.ERRORS.MAX.WARN} per second for 5m)'
              priority: WARNING
              tags:
                - tag: scope
                  value: health
        - uuid: 3c9fb90492e44789ba9a899d03546b6d
          name: 'SQL statements: Executed, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.executed.rate
          value_type: FLOAT
          description: 'Number of SQL queries executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_query_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: ae83868ea1194089a65b9c3bfb81ef27
          name: 'SQL statements: Active flows distributed, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.flows.active.rate
          value_type: FLOAT
          description: 'The number of distributed SQL flows currently active per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_distsql_flows_active
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: b9c72429c3264119af27e3b4d1c7486a
          name: 'SQL statements: INSERT, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.insert.rate
          value_type: FLOAT
          description: 'A moving average of the number of INSERT statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_insert_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: d6fc464f4e784569911880f52020d08d
          name: 'SQL statements: SELECT, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.select.rate
          value_type: FLOAT
          description: 'A moving average of the number of SELECT statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_select_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 8832cd69551a4ad084c283fb076a17b6
          name: 'SQL statements: UPDATE, rate'
          type: DEPENDENT
          key: cockroachdb.sql.statements.update.rate
          value_type: FLOAT
          description: 'A moving average of the number of UPDATE statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_update_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 6e2f06b2b71f447aae06940b205e22bf
          name: 'SQL transactions: Aborted, rate'
          type: DEPENDENT
          key: cockroachdb.sql.transactions.aborted.rate
          value_type: FLOAT
          description: 'Total number of SQL transaction abort errors per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_txn_abort_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: d32b3f22158f4091926ebf9746439da3
          name: 'SQL transactions: Committed, rate'
          type: DEPENDENT
          key: cockroachdb.sql.transactions.committed.rate
          value_type: FLOAT
          description: 'Total number of SQL transaction COMMIT statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_txn_commit_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: ca529d30b36e4bf591c8b5e313f9bbc0
          name: 'SQL transactions: Initiated, rate'
          type: DEPENDENT
          key: cockroachdb.sql.transactions.initiated.rate
          value_type: FLOAT
          description: 'Total number of SQL transaction BEGIN statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_txn_begin_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 6490aac99d654eebae14cedb935c8d9f
          name: 'SQL transactions: Open'
          type: DEPENDENT
          key: cockroachdb.sql.transactions.open
          value_type: FLOAT
          description: 'Total number of currently open SQL transactions.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_txns_open
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 07274667c22d4e52b50ead17c864ae36
          name: 'SQL transactions: Rolled back, rate'
          type: DEPENDENT
          key: cockroachdb.sql.transactions.rollbacks.rate
          value_type: FLOAT
          description: 'Total number of SQL transaction ROLLBACK statements successfully executed per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sql_txn_rollback_count
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 5b96333392ac4e678204d048b4940135
          name: 'Time series: Sample errors, rate'
          type: DEPENDENT
          key: cockroachdb.ts.samples.errors.rate
          value_type: FLOAT
          description: 'The number of errors encountered while attempting to write metrics to disk, per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - timeseries_write_errors
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: timeseries
        - uuid: 444fbc4df9c64e92bd3f41022539a940
          name: 'Time series: Samples written, rate'
          type: DEPENDENT
          key: cockroachdb.ts.samples.written.rate
          value_type: FLOAT
          description: 'The number of successfully written metric samples per second.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - timeseries_write_samples
                - value
                - ''
            - type: CHANGE_PER_SECOND
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: timeseries
        - uuid: b200e1f665ad425394e631b2844a1fdb
          name: Uptime
          type: DEPENDENT
          key: cockroachdb.uptime
          value_type: FLOAT
          units: s
          description: 'Process uptime.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - sys_uptime
                - value
                - ''
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: 90f6cccaf3d94a3d853641482ccb5254
              expression: 'nodata(/CockroachDB by HTTP/cockroachdb.uptime,5m) = 1'
              name: 'Failed to fetch node data'
              event_name: 'Failed to fetch node data (or no data for 5m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 5 minutes.'
              dependencies:
                - name: 'Service is down'
                  expression: 'last(/CockroachDB by HTTP/net.tcp.service["{$COCKROACHDB.API.SCHEME}","{$COCKROACHDB.API.HOST}","{$COCKROACHDB.API.PORT}"]) = 0'
              tags:
                - tag: scope
                  value: availability
            - uuid: 83802e38f1414ca9b40e2d2df2d94941
              expression: 'last(/CockroachDB by HTTP/cockroachdb.uptime) < 10m'
              name: 'Node has been restarted'
              event_name: 'Node has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes.'
              tags:
                - tag: scope
                  value: notice
        - uuid: d588fc919b364889abd98537dfc80575
          name: Version
          type: DEPENDENT
          key: cockroachdb.version
          value_type: CHAR
          description: 'Build information.'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - build_timestamp
                - label
                - tag
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: cockroachdb.get_metrics
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: 620aee1613e841acb44a438b4b9b68c9
              expression: 'last(/CockroachDB by HTTP/cockroachdb.version) <> last(/CockroachDB by HTTP/cockroachdb.version,#2) and length(last(/CockroachDB by HTTP/cockroachdb.version)) > 0'
              name: 'Version has changed'
              event_name: 'Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
        - uuid: 00afa7b32af9499c89e939c96e0e29d1
          name: 'Service ping'
          type: SIMPLE
          key: 'net.tcp.service["{$COCKROACHDB.API.SCHEME}","{$COCKROACHDB.API.HOST}","{$COCKROACHDB.API.PORT}"]'
          description: 'Check if HTTP/HTTPS service accepts TCP connections.'
          valuemap:
            name: 'Service state'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: d3c0d0a9e1f44c95a2246ab7081f581b
              expression: 'last(/CockroachDB by HTTP/net.tcp.service["{$COCKROACHDB.API.SCHEME}","{$COCKROACHDB.API.HOST}","{$COCKROACHDB.API.PORT}"]) = 0'
              name: 'Service is down'
              priority: AVERAGE
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: c201ddd6c35c4d67a05b9a99952f54f2
          name: 'Storage metrics discovery'
          type: DEPENDENT
          key: cockroachdb.store.discovery
          description: 'Discover per store metrics.'
          item_prototypes:
            - uuid: a12e4937d2c44eacada535774e74653a
              name: 'Storage [{#STORE}]: Queue processing failures: Consistency, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.consistency.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the consistency checker queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_consistency_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: 5d328a66855d4cbba099713befd4d240
              name: 'Storage [{#STORE}]: Queue processing failures: GC, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.gc.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the GC queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_gc_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: b71cc221443b42888d64dea02e75d3f9
              name: 'Storage [{#STORE}]: Queue processing failures: Replica GC, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.gc_replica.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the replica GC queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_replicagc_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: eabbf198e158428aaf9b15f491dd0895
              name: 'Storage [{#STORE}]: Queue processing failures: Raft log, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.raftlog.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the Raft log queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_raftlog_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: 2369ad2e98c84d2a83b64f3b1fce826e
              name: 'Storage [{#STORE}]: Queue processing failures: Raft snapshot, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.raftsnapshot.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the Raft repair queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_raftsnapshot_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: 604df422fb084fba8480758e30fc81f3
              name: 'Storage [{#STORE}]: Queue processing failures: Replicate, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.replicate.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the replicate queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_replicate_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: 40e94d8e2cc54c7b9c0a6c4d7c8dc308
              name: 'Storage [{#STORE}]: Queue processing failures: Split, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.split.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the split queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_split_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: ceb47605bc364044993e59430f37a07c
              name: 'Storage [{#STORE}]: Queue processing failures: Time series maintenance, rate'
              type: DEPENDENT
              key: 'cockroachdb.queue.processing_failures.tsmaintenance.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of replicas which failed processing in the time series maintenance queue per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'queue_tsmaintenance_process_failure{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: queues
            - uuid: 4ed616f13c9d4669879aa8bdad35a06a
              name: 'Storage [{#STORE}]: Ranges count'
              type: DEPENDENT
              key: 'cockroachdb.ranges.[{#STORE},count]'
              value_type: FLOAT
              description: 'Number of ranges.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'ranges{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: ranges
            - uuid: 63e70400900a4b5caa8e89a18c83ebd7
              name: 'Storage [{#STORE}]: Ranges unavailable'
              type: DEPENDENT
              key: 'cockroachdb.ranges.[{#STORE},unavailable]'
              value_type: FLOAT
              description: 'Number of ranges with fewer live replicas than needed for quorum.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'ranges_unavailable{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: ranges
            - uuid: beea6adf48df454fa6628d44455ca52f
              name: 'Storage [{#STORE}]: Ranges underreplicated'
              type: DEPENDENT
              key: 'cockroachdb.ranges.[{#STORE},underreplicated]'
              value_type: FLOAT
              description: 'Number of ranges with fewer live replicas than the replication target.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'ranges_underreplicated{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: ranges
            - uuid: d0b45b5a00d64c39bce2117fdb35d373
              name: 'Storage [{#STORE}]: Rebalancing: Average queries, rate'
              type: DEPENDENT
              key: 'cockroachdb.rebalancing.queries.average.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of kv-level requests received per second by the store, averaged over a large time period as used in rebalancing decisions.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'rebalancing_queriespersecond{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: rebalancing
            - uuid: b5c10de1a784458f9df54813cc10c32b
              name: 'Storage [{#STORE}]: Rebalancing: Average writes, rate'
              type: DEPENDENT
              key: 'cockroachdb.rebalancing.writes.average.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Number of keys written (i.e. applied by raft) per second to the store, averaged over a large time period as used in rebalancing decisions.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'rebalancing_writespersecond{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: rebalancing
            - uuid: 191985a08c554160bc371f5fca638336
              name: 'Storage [{#STORE}]: Replication: Replicas'
              type: DEPENDENT
              key: 'cockroachdb.replication.replicas.[{#STORE},count]'
              value_type: FLOAT
              description: 'Number of replicas.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'replicas{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: replication
            - uuid: 089c354ee1c547808bbf8655d16d1a06
              name: 'Storage [{#STORE}]: Replication: Replicas quiesced'
              type: DEPENDENT
              key: 'cockroachdb.replication.replicas.[{#STORE},quiesced]'
              value_type: FLOAT
              description: 'Number of quiesced replicas.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'replicas_quiescent{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: replication
            - uuid: 87f949f768b54ba1b648a04d86f4c4da
              name: 'Storage [{#STORE}]: Replication: Lease holders'
              type: DEPENDENT
              key: 'cockroachdb.replication.[{#STORE},lease_holders]'
              value_type: FLOAT
              description: 'Number of lease holders.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'replicas_leaseholders{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: replication
            - uuid: eb6202583eb24ac28b60a8d5f24c1ccf
              name: 'Storage [{#STORE}]: RocksDB cache hits, rate'
              type: DEPENDENT
              key: 'cockroachdb.rocksdb.cache.hits.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Count of block cache hits per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'rocksdb_block_cache_hits{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: rocksdb
            - uuid: 278d4cbcaa844f1281dd029da54300e4
              name: 'Storage [{#STORE}]: RocksDB cache misses, rate'
              type: DEPENDENT
              key: 'cockroachdb.rocksdb.cache.misses.[{#STORE},rate]'
              value_type: FLOAT
              description: 'Count of block cache misses per second.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'rocksdb_block_cache_misses{store="{#STORE}"}'
                    - value
                    - ''
                - type: CHANGE_PER_SECOND
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: rocksdb
            - uuid: cafdf6248d114787b2a3f9647a4afea9
              name: 'Storage [{#STORE}]: RocksDB cache hit ratio'
              type: CALCULATED
              key: 'cockroachdb.rocksdb.cache.[{#STORE},hit_ratio]'
              value_type: FLOAT
              units: '%'
              params: 'last(//cockroachdb.rocksdb.cache.hits.[{#STORE},rate]) / (last(//cockroachdb.rocksdb.cache.hits.[{#STORE},rate]) + last(//cockroachdb.rocksdb.cache.misses.[{#STORE},rate])) * 100'
              description: 'Block cache hit ratio in %.'
              tags:
                - tag: component
                  value: rocksdb
            - uuid: f4175e8984d14ad89c0bd1fce5b37372
              name: 'Storage [{#STORE}]: RocksDB read amplification'
              type: DEPENDENT
              key: 'cockroachdb.rocksdb.[{#STORE},read_amp]'
              value_type: FLOAT
              description: 'The average number of real read operations executed per logical read operation.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'rocksdb_read_amplification{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: rocksdb
            - uuid: edc1e5548d9e4d629b44b067ffc666b9
              name: 'Storage [{#STORE}]: RocksDB SSTables'
              type: DEPENDENT
              key: 'cockroachdb.rocksdb.[{#STORE},sstables]'
              value_type: FLOAT
              description: 'The number of SSTables in use.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'rocksdb_num_sstables{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: rocksdb
            - uuid: 6e826e48da5844468ba8d14ae0f1acc4
              name: 'Storage [{#STORE}]: Slow requests: Latch acquisitions'
              type: DEPENDENT
              key: 'cockroachdb.slow_requests.[{#STORE},latch_acquisitions]'
              value_type: FLOAT
              description: 'Number of requests that have been stuck for a long time acquiring latches.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'requests_slow_latch{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: requests
            - uuid: 0cc9c428567a47c6adb41d137965a362
              name: 'Storage [{#STORE}]: Slow requests: Lease acquisitions'
              type: DEPENDENT
              key: 'cockroachdb.slow_requests.[{#STORE},lease_acquisitions]'
              value_type: FLOAT
              description: 'Number of requests that have been stuck for a long time acquiring a lease.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'requests_slow_lease{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: requests
            - uuid: 11c9e0dea4ec48a69ff3961aa6d1f910
              name: 'Storage [{#STORE}]: Slow requests: Raft proposals'
              type: DEPENDENT
              key: 'cockroachdb.slow_requests.[{#STORE},raft_proposals]'
              value_type: FLOAT
              description: 'Number of requests that have been stuck for a long time in raft.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'requests_slow_raft{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: requests
            - uuid: bbf0f281f3aa4964829ed2213db5dfc7
              name: 'Storage [{#STORE}]: Bytes: Live'
              type: DEPENDENT
              key: 'cockroachdb.storage.bytes.[{#STORE},live]'
              value_type: FLOAT
              units: B
              description: 'Number of logical bytes stored in live key-value pairs on this node. Live data excludes historical and deleted data.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'livebytes{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: storage
            - uuid: 232970f8bf12412e8a6bd96978a7ad5f
              name: 'Storage [{#STORE}]: Bytes: Logical'
              type: DEPENDENT
              key: 'cockroachdb.storage.bytes.[{#STORE},logical]'
              value_type: FLOAT
              units: B
              description: 'Number of logical bytes stored in key-value pairs on this node. This includes historical and deleted data.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'totalbytes{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: storage
            - uuid: 58d6f4d3c9ff41cab05697e7c59cf8e2
              name: 'Storage [{#STORE}]: Bytes: System'
              type: DEPENDENT
              key: 'cockroachdb.storage.bytes.[{#STORE},system]'
              value_type: FLOAT
              units: B
              description: 'Number of physical bytes stored in system key-value pairs.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'sysbytes{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: storage
            - uuid: 01c02c5a9c174cd2b958634da07824e5
              name: 'Storage [{#STORE}]: Capacity available'
              type: DEPENDENT
              key: 'cockroachdb.storage.capacity.[{#STORE},available]'
              value_type: FLOAT
              units: B
              description: 'Available storage capacity.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'capacity_available{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: storage
            - uuid: bb07359b779d4e4080593a02c18dc8c1
              name: 'Storage [{#STORE}]: Capacity available in %'
              type: CALCULATED
              key: 'cockroachdb.storage.capacity.[{#STORE},available_percent]'
              value_type: FLOAT
              units: '%'
              params: 'last(//cockroachdb.storage.capacity.[{#STORE},available]) / last(//cockroachdb.storage.capacity.[{#STORE},total]) * 100'
              description: 'Available storage capacity in %.'
              tags:
                - tag: component
                  value: storage
              trigger_prototypes:
                - uuid: db07663014aa47a892faa2f9dbd97ec9
                  expression: 'max(/CockroachDB by HTTP/cockroachdb.storage.capacity.[{#STORE},available_percent],5m) < {$COCKROACHDB.STORE.USED.MIN.CRIT}'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'min(/CockroachDB by HTTP/cockroachdb.storage.capacity.[{#STORE},available_percent],5m) > {$COCKROACHDB.STORE.USED.MIN.CRIT}'
                  name: 'Storage [{#STORE}]: Available storage capacity is critically low'
                  event_name: 'Storage [{#STORE}]: Available storage capacity is critically low (less than {$COCKROACHDB.STORE.USED.MIN.CRIT}%)'
                  priority: AVERAGE
                  description: 'Storage is running critically low on free space (less than {$COCKROACHDB.STORE.USED.MIN.CRIT}% available).'
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: a58b694f4cf642228ec0633f0efb04a7
                  expression: 'max(/CockroachDB by HTTP/cockroachdb.storage.capacity.[{#STORE},available_percent],5m) < {$COCKROACHDB.STORE.USED.MIN.WARN}'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'min(/CockroachDB by HTTP/cockroachdb.storage.capacity.[{#STORE},available_percent],5m) > {$COCKROACHDB.STORE.USED.MIN.WARN}'
                  name: 'Storage [{#STORE}]: Available storage capacity is low'
                  event_name: 'Storage [{#STORE}]: Available storage capacity is low (less than {$COCKROACHDB.STORE.USED.MIN.WARN}%)'
                  priority: WARNING
                  description: 'Storage is running low on free space (less than {$COCKROACHDB.STORE.USED.MIN.WARN}% available).'
                  dependencies:
                    - name: 'Storage [{#STORE}]: Available storage capacity is critically low'
                      expression: 'max(/CockroachDB by HTTP/cockroachdb.storage.capacity.[{#STORE},available_percent],5m) < {$COCKROACHDB.STORE.USED.MIN.CRIT}'
                      recovery_expression: 'min(/CockroachDB by HTTP/cockroachdb.storage.capacity.[{#STORE},available_percent],5m) > {$COCKROACHDB.STORE.USED.MIN.CRIT}'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 35ce626304fb4d39bd382161cb052346
              name: 'Storage [{#STORE}]: Capacity total'
              type: DEPENDENT
              key: 'cockroachdb.storage.capacity.[{#STORE},total]'
              value_type: FLOAT
              units: B
              description: 'Total storage capacity. This value may be explicitly set using --store. If a store size has not been set, this metric displays the actual disk capacity.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'capacity{store="{#STORE}"}'
                    - value
                    - ''
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: storage
            - uuid: b6db680d16bc41408d13f7275c603fca
              name: 'Storage [{#STORE}]: Capacity used'
              type: DEPENDENT
              key: 'cockroachdb.storage.capacity.[{#STORE},used]'
              value_type: FLOAT
              units: B
              description: 'Disk space in use by CockroachDB data on this node. This excludes the Cockroach binary, operating system, and other system files.'
              preprocessing:
                - type: PROMETHEUS_PATTERN
                  parameters:
                    - 'capacity_used{store="{#STORE}"}'
                    - value
                    - ''
              master_item:
                key: cockroachdb.get_metrics
              tags:
                - tag: component
                  value: storage
          graph_prototypes:
            - uuid: 4cd837e243f14174a6d259b359e4f90d
              name: 'CockroachDB: Storage [{#STORE}]: Bytes'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.storage.bytes.[{#STORE},live]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.storage.bytes.[{#STORE},system]'
            - uuid: f5054466f5834071ad9e3bd50764ba29
              name: 'CockroachDB: Storage [{#STORE}]: Capacity'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.storage.capacity.[{#STORE},total]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.storage.capacity.[{#STORE},available]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.storage.capacity.[{#STORE},used]'
            - uuid: e6763dafd3c54e0787eae612921e35f8
              name: 'CockroachDB: Storage [{#STORE}]: Queue processing failures'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.consistency.[{#STORE},rate]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.gc.[{#STORE},rate]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.raftlog.[{#STORE},rate]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.raftsnapshot.[{#STORE},rate]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.gc_replica.[{#STORE},rate]'
                - sortorder: '5'
                  color: 6C59DC
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.replicate.[{#STORE},rate]'
                - sortorder: '6'
                  color: C7A72D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.split.[{#STORE},rate]'
                - sortorder: '7'
                  color: BA2A5D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.queue.processing_failures.tsmaintenance.[{#STORE},rate]'
            - uuid: 0c4977666e5e4af1b5e1f840284fe7d0
              name: 'CockroachDB: Storage [{#STORE}]: Ranges'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.ranges.[{#STORE},count]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.replication.[{#STORE},lease_holders]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.ranges.[{#STORE},unavailable]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.ranges.[{#STORE},underreplicated]'
            - uuid: 811d38ab09494628ae6ac36aa54c1795
              name: 'CockroachDB: Storage [{#STORE}]: Replica quiescence'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.replication.replicas.[{#STORE},count]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'CockroachDB by HTTP'
                    key: 'cockroachdb.replication.replicas.[{#STORE},quiesced]'
          master_item:
            key: cockroachdb.get_metrics
          lld_macro_paths:
            - lld_macro: '{#STORE}'
              path: $.labels.store
          preprocessing:
            - type: PROMETHEUS_TO_JSON
              parameters:
                - capacity
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
      tags:
        - tag: class
          value: database
        - tag: target
          value: cockroachdb
      macros:
        - macro: '{$COCKROACHDB.API.HOST}'
          value: '<SET COCKROACHDB HOST>'
          description: 'The hostname or IP address of the CockroachDB host.'
        - macro: '{$COCKROACHDB.API.PORT}'
          value: '8080'
          description: 'The port of CockroachDB API and Prometheus endpoint.'
        - macro: '{$COCKROACHDB.API.SCHEME}'
          value: http
          description: 'Request scheme which may be http or https.'
        - macro: '{$COCKROACHDB.CERT.CA.EXPIRY.WARN}'
          value: '90'
          description: 'Number of days until the CA certificate expires.'
        - macro: '{$COCKROACHDB.CERT.NODE.EXPIRY.WARN}'
          value: '30'
          description: 'Number of days until the node certificate expires.'
        - macro: '{$COCKROACHDB.CLOCK.OFFSET.MAX.WARN}'
          value: '300'
          description: 'Maximum clock offset of the node against the rest of the cluster in milliseconds for trigger expression.'
        - macro: '{$COCKROACHDB.OPEN.FDS.MAX.WARN}'
          value: '80'
          description: 'Maximum percentage of used file descriptors.'
        - macro: '{$COCKROACHDB.STATEMENTS.ERRORS.MAX.WARN}'
          value: '2'
          description: 'Maximum number of SQL statements errors for trigger expression.'
        - macro: '{$COCKROACHDB.STORE.USED.MIN.CRIT}'
          value: '10'
          description: 'The critical threshold of the available disk space in percent.'
        - macro: '{$COCKROACHDB.STORE.USED.MIN.WARN}'
          value: '20'
          description: 'The warning threshold of the available disk space in percent.'
      dashboards:
        - uuid: fda49a1847d34b84be2fe5d9d12b8444
          name: Hardware
          pages:
            - name: Hardware
              widgets:
                - type: graph
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.cpu.util
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '5'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Memory usage'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graphprototype
                  'y': '10'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Storage [{#STORE}]: Capacity'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  'y': '15'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Disk: r/w, rate'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: graph
                  'y': '20'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Disk: r/w IOPS, rate'
                    - type: STRING
                      name: reference
                      value: AAAAE
                - type: graph
                  'y': '25'
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.disk.iops.in_progress.rate
                    - type: STRING
                      name: reference
                      value: AAAAF
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '30'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Network traffic'
                    - type: STRING
                      name: reference
                      value: AAAAG
        - uuid: 41dce007bcf54762ad321ac944a8b63e
          name: Replication
          pages:
            - name: Replication
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Storage [{#STORE}]: Ranges'
                    - type: STRING
                      name: reference
                      value: AAAAH
                - type: graphprototype
                  'y': '5'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: 'cockroachdb.replication.[{#STORE},lease_holders]'
                    - type: STRING
                      name: reference
                      value: AAAAI
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: graphprototype
                  'y': '10'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: 'cockroachdb.rebalancing.queries.average.[{#STORE},rate]'
                    - type: STRING
                      name: reference
                      value: AAAAJ
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: graphprototype
                  'y': '15'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Storage [{#STORE}]: Replica quiescence'
                    - type: STRING
                      name: reference
                      value: AAAAK
        - uuid: 0d9a3feb76ad403dac7379dbe04298f0
          name: Runtime
          pages:
            - name: Runtime
              widgets:
                - type: graph
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.live_count
                    - type: STRING
                      name: reference
                      value: AAAAL
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '5'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Memory usage'
                    - type: STRING
                      name: reference
                      value: AAAAM
                - type: graph
                  'y': '10'
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.go.goroutines.count
                    - type: STRING
                      name: reference
                      value: AAAAN
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '15'
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.gc.runs.rate
                    - type: STRING
                      name: reference
                      value: AAAAO
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '20'
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.gc.pause_time
                    - type: STRING
                      name: reference
                      value: AAAAP
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '25'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: CPU Time'
                    - type: STRING
                      name: reference
                      value: AAAAQ
                - type: graph
                  'y': '30'
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.clock.offset
                    - type: STRING
                      name: reference
                      value: AAAAR
                    - type: INTEGER
                      name: source_type
                      value: '1'
        - uuid: ac89b176f2c34fc1b885ee1ed43df590
          name: 'Slow requests'
          pages:
            - name: 'Slow requests'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: 'cockroachdb.slow_requests.[{#STORE},raft_proposals]'
                    - type: STRING
                      name: reference
                      value: AAAAS
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: graph
                  'y': '5'
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.slow_requests.rpc
                    - type: STRING
                      name: reference
                      value: AAAAT
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graphprototype
                  'y': '10'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: 'cockroachdb.slow_requests.[{#STORE},lease_acquisitions]'
                    - type: STRING
                      name: reference
                      value: AAAAU
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: graphprototype
                  'y': '15'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: 'cockroachdb.slow_requests.[{#STORE},latch_acquisitions]'
                    - type: STRING
                      name: reference
                      value: AAAAV
                    - type: INTEGER
                      name: source_type
                      value: '3'
        - uuid: b1086a92f1b54c45be99efd996b33457
          name: SQL
          pages:
            - name: SQL
              widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.sessions
                    - type: STRING
                      name: reference
                      value: AAAAW
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.statements.active
                    - type: STRING
                      name: reference
                      value: AAAAY
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '10'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: SQL statements'
                    - type: STRING
                      name: reference
                      value: AAABA
                - type: graph
                  'y': '15'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.statements.contention.rate
                    - type: STRING
                      name: reference
                      value: AAABC
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '20'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: SQL transactions'
                    - type: STRING
                      name: reference
                      value: AAABE
                - type: graph
                  'y': '25'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.memory.sql
                    - type: STRING
                      name: reference
                      value: AAABF
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  'y': '30'
                  width: '72'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.statements.denials.rate
                    - type: STRING
                      name: reference
                      value: AAABH
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.transactions.open
                    - type: STRING
                      name: reference
                      value: AAAAX
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  x: '36'
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: SQL: Traffic'
                    - type: STRING
                      name: reference
                      value: AAAAZ
                - type: graph
                  x: '36'
                  'y': '10'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.statements.errors.rate
                    - type: STRING
                      name: reference
                      value: AAABB
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  x: '36'
                  'y': '15'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.statements.flows.active.rate
                    - type: STRING
                      name: reference
                      value: AAABD
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  x: '36'
                  'y': '25'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: cockroachdb.sql.schema_changes.rate
                    - type: STRING
                      name: reference
                      value: AAABG
                    - type: INTEGER
                      name: source_type
                      value: '1'
        - uuid: aa41ca45023c4d0eb126596f89f20f98
          name: Storage
          pages:
            - name: Storage
              widgets:
                - type: graphprototype
                  width: '36'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Storage [{#STORE}]: Capacity'
                    - type: STRING
                      name: reference
                      value: AAABI
                - type: graphprototype
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: 'cockroachdb.rocksdb.[{#STORE},read_amp]'
                    - type: STRING
                      name: reference
                      value: AAABK
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: graph
                  'y': '10'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: File descriptors'
                    - type: STRING
                      name: reference
                      value: AAABM
                - type: graphprototype
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Storage [{#STORE}]: Bytes'
                    - type: STRING
                      name: reference
                      value: AAABJ
                - type: graphprototype
                  x: '36'
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        key: 'cockroachdb.rocksdb.[{#STORE},sstables]'
                    - type: STRING
                      name: reference
                      value: AAABL
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: graph
                  x: '36'
                  'y': '10'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'CockroachDB by HTTP'
                        name: 'CockroachDB: Time series'
                    - type: STRING
                      name: reference
                      value: AAABN
      valuemaps:
        - uuid: 2e7ddaadebce4b1089dcf01a91d01293
          name: 'Node health'
          mappings:
            - value: '200'
              newvalue: Healthy
            - value: '500'
              newvalue: 'Not healthy'
        - uuid: 705e364c9e1b44dbb3fb50a1b27a8cdb
          name: 'Node readiness'
          mappings:
            - value: '200'
              newvalue: Ready
            - value: '503'
              newvalue: 'Not ready'
        - uuid: cc5f50f62d4a4895aa64d167f56cb99c
          name: 'Service state'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
  triggers:
    - uuid: 8c2035ad44ea44b2b690b086d11e8cfc
      expression: 'min(/CockroachDB by HTTP/cockroachdb.descriptors.open,10m) / last(/CockroachDB by HTTP/cockroachdb.descriptors.limit) * 100 > {$COCKROACHDB.OPEN.FDS.MAX.WARN}'
      name: 'Current number of open files is too high'
      event_name: 'Current number of open files is too high (over {$COCKROACHDB.OPEN.FDS.MAX.WARN}% for 10m)'
      priority: WARNING
      description: 'Getting close to open file descriptor limit.'
    - uuid: b099e323ec974823bfd84317b152a1fb
      expression: 'last(/CockroachDB by HTTP/cockroachdb.sql.sessions) > 0 and last(/CockroachDB by HTTP/cockroachdb.sql.statements.executed.rate) = 0'
      name: 'Node is not executing SQL'
      priority: WARNING
      description: 'Node is not executing SQL despite having connections.'
      tags:
        - tag: scope
          value: notice
    - uuid: 0d2fa3b6ea434a07867b9f4d6156ea81
      expression: 'last(/CockroachDB by HTTP/cockroachdb.get_readiness) = 503 and last(/CockroachDB by HTTP/cockroachdb.uptime) > 5m'
      name: 'Node is not ready'
      priority: AVERAGE
      description: |
        Node's /health?ready=1 endpoint has returned HTTP 503 Service Unavailable. Possible reasons:
        - node is in the wait phase of the node shutdown sequence;
        - node is unable to communicate with a majority of the other nodes in the cluster, likely because the cluster is unavailable due to too many nodes being down.
      dependencies:
        - name: 'Service is down'
          expression: 'last(/CockroachDB by HTTP/net.tcp.service["{$COCKROACHDB.API.SCHEME}","{$COCKROACHDB.API.HOST}","{$COCKROACHDB.API.PORT}"]) = 0'
      tags:
        - tag: scope
          value: health
  graphs:
    - uuid: 4706e010045343cfa5a6d211ec6c0efd
      name: 'CockroachDB: CPU Time'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.cpu.user_time
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.cpu.system_time
    - uuid: 5d194c6e35c64bfd88a801668bc5ac49
      name: 'CockroachDB: Disk: r/w, rate'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.disk.read.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.disk.write.rate
    - uuid: 7808c1bcbf8b4672b5d8a7c26ec97745
      name: 'CockroachDB: Disk: r/w IOPS, rate'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.disk.iops.read.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.disk.iops.write.rate
    - uuid: 1206fc26b6c342b9a85b4a9ea4b1f8b5
      name: 'CockroachDB: File descriptors'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.descriptors.limit
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.descriptors.open
    - uuid: 919586b301534623b16d5aadef0de5a6
      name: 'CockroachDB: KV transactions'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.kv.transactions.committed.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.kv.transactions.aborted.rate
    - uuid: 0bc7a266933e407c85e903cfb6b2b7c9
      name: 'CockroachDB: Memory usage'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.memory.total
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.memory.go.allocated
        - sortorder: '2'
          color: 00611C
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.memory.go.managed
        - sortorder: '3'
          color: F7941D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.memory.cgo.allocated
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.memory.cgo.managed
    - uuid: 4f02255476334f79a9373c1966a1b787
      name: 'CockroachDB: Network traffic'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.network.bytes.received.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.network.bytes.sent.rate
    - uuid: b6f9d3cda4a5451da3d90107960e91b7
      name: 'CockroachDB: SQL: Traffic'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.bytes.received.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.bytes.sent.rate
    - uuid: 76bfd0743c63481db9793e3c55181bc9
      name: 'CockroachDB: SQL statements'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.statements.update.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.statements.select.rate
        - sortorder: '2'
          color: 00611C
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.statements.insert.rate
        - sortorder: '3'
          color: F7941D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.statements.delete.rate
    - uuid: 53151cd0e61d487485f8d201c6881d59
      name: 'CockroachDB: SQL transactions'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.transactions.initiated.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.transactions.committed.rate
        - sortorder: '2'
          color: 00611C
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.transactions.rollbacks.rate
        - sortorder: '3'
          color: F7941D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.sql.transactions.aborted.rate
    - uuid: 0c313bd2041942649c1f1c441e812388
      name: 'CockroachDB: Time series'
      graph_items:
        - color: 199C0D
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.ts.samples.written.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'CockroachDB by HTTP'
            key: cockroachdb.ts.samples.errors.rate
