github.com/netdata/go.d.plugin@v0.58.1/modules/cockroachdb/integrations/cockroachdb.md (about)

     1  <!--startmeta
     2  custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/cockroachdb/README.md"
     3  meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/cockroachdb/metadata.yaml"
     4  sidebar_label: "CockroachDB"
     5  learn_status: "Published"
     6  learn_rel_path: "Data Collection/Databases"
     7  most_popular: False
     8  message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
     9  endmeta-->
    10  
    11  # CockroachDB
    12  
    13  
    14  <img src="https://netdata.cloud/img/cockroachdb.svg" width="150"/>
    15  
    16  
    17  Plugin: go.d.plugin
    18  Module: cockroachdb
    19  
    20  <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
    21  
    22  ## Overview
    23  
    24  This collector monitors CockroachDB servers.
    25  
    26  
    27  
    28  
    29  This collector is supported on all platforms.
    30  
    31  This collector supports collecting metrics from multiple instances of this integration, including remote instances.
    32  
    33  
    34  ### Default Behavior
    35  
    36  #### Auto-Detection
    37  
    38  This integration doesn't support auto-detection.
    39  
    40  #### Limits
    41  
    42  The default configuration for this integration does not impose any limits on data collection.
    43  
    44  #### Performance Impact
    45  
    46  The default configuration for this integration is not expected to impose a significant performance impact on the system.
    47  
    48  
    49  ## Metrics
    50  
    51  Metrics grouped by *scope*.
    52  
    53  The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
    54  
    55  
    56  
    57  ### Per CockroachDB instance
    58  
    59  These metrics refer to the entire monitored application.
    60  
    61  This scope has no labels.
    62  
    63  Metrics:
    64  
    65  | Metric | Dimensions | Unit |
    66  |:------|:----------|:----|
    67  | cockroachdb.process_cpu_time_combined_percentage | used | percentage |
    68  | cockroachdb.process_cpu_time_percentage | user, sys | percentage |
    69  | cockroachdb.process_cpu_time | user, sys | ms |
    70  | cockroachdb.process_memory | rss | KiB |
    71  | cockroachdb.process_file_descriptors | open | fd |
    72  | cockroachdb.process_uptime | uptime | seconds |
    73  | cockroachdb.host_disk_bandwidth | read, write | KiB |
    74  | cockroachdb.host_disk_operations | reads, writes | operations |
    75  | cockroachdb.host_disk_iops_in_progress | in_progress | iops |
    76  | cockroachdb.host_network_bandwidth | received, sent | kilobits |
    77  | cockroachdb.host_network_packets | received, sent | packets |
    78  | cockroachdb.live_nodes | live_nodes | nodes |
    79  | cockroachdb.node_liveness_heartbeats | successful, failed | heartbeats |
    80  | cockroachdb.total_storage_capacity | total | KiB |
    81  | cockroachdb.storage_capacity_usability | usable, unusable | KiB |
    82  | cockroachdb.storage_usable_capacity | available, used | KiB |
    83  | cockroachdb.storage_used_capacity_percentage | total, usable | percentage |
    84  | cockroachdb.sql_connections | active | connections |
    85  | cockroachdb.sql_bandwidth | received, sent | KiB |
    86  | cockroachdb.sql_statements_total | started, executed | statements |
    87  | cockroachdb.sql_errors | statement, transaction | errors |
    88  | cockroachdb.sql_started_ddl_statements | ddl | statements |
    89  | cockroachdb.sql_executed_ddl_statements | ddl | statements |
    90  | cockroachdb.sql_started_dml_statements | select, update, delete, insert | statements |
    91  | cockroachdb.sql_executed_dml_statements | select, update, delete, insert | statements |
    92  | cockroachdb.sql_started_tcl_statements | begin, commit, rollback, savepoint, savepoint_cockroach_restart, release_savepoint_cockroach_restart, rollback_to_savepoint_cockroach_restart | statements |
    93  | cockroachdb.sql_executed_tcl_statements | begin, commit, rollback, savepoint, savepoint_cockroach_restart, release_savepoint_cockroach_restart, rollback_to_savepoint_cockroach_restart | statements |
    94  | cockroachdb.sql_active_distributed_queries | active | queries |
    95  | cockroachdb.sql_distributed_flows | active, queued | flows |
    96  | cockroachdb.live_bytes | applications, system | KiB |
    97  | cockroachdb.logical_data | keys, values | KiB |
    98  | cockroachdb.logical_data_count | keys, values | num |
    99  | cockroachdb.kv_transactions | committed, fast-path_committed, aborted | transactions |
   100  | cockroachdb.kv_transaction_restarts | write_too_old, write_too_old_multiple, forwarded_timestamp, possible_reply, async_consensus_failure, read_within_uncertainty_interval, aborted, push_failure, unknown | restarts |
   101  | cockroachdb.ranges | ranges | ranges |
   102  | cockroachdb.ranges_replication_problem | unavailable, under_replicated, over_replicated | ranges |
   103  | cockroachdb.range_events | split, add, remove, merge | events |
   104  | cockroachdb.range_snapshot_events | generated, applied_raft_initiated, applied_learner, applied_preemptive | events |
   105  | cockroachdb.rocksdb_read_amplification | reads | reads/query |
   106  | cockroachdb.rocksdb_table_operations | compactions, flushes | operations |
   107  | cockroachdb.rocksdb_cache_usage | used | KiB |
   108  | cockroachdb.rocksdb_cache_operations | hits, misses | operations |
   109  | cockroachdb.rocksdb_cache_hit_rate | hit_rate | percentage |
   110  | cockroachdb.rocksdb_sstables | sstables | sstables |
   111  | cockroachdb.replicas | replicas | replicas |
   112  | cockroachdb.replicas_quiescence | quiescent, active | replicas |
   113  | cockroachdb.replicas_leaders | leaders, not_leaseholders | replicas |
   114  | cockroachdb.replicas_leaseholders | leaseholders | leaseholders |
   115  | cockroachdb.queue_processing_failures | gc, replica_gc, replication, split, consistency, raft_log, raft_snapshot, time_series_maintenance | failures |
   116  | cockroachdb.rebalancing_queries | avg | queries/s |
   117  | cockroachdb.rebalancing_writes | avg | writes/s |
   118  | cockroachdb.timeseries_samples | written | samples |
   119  | cockroachdb.timeseries_write_errors | write | errors |
   120  | cockroachdb.timeseries_write_bytes | written | KiB |
   121  | cockroachdb.slow_requests | acquiring_latches, acquiring_lease, in_raft | requests |
   122  | cockroachdb.code_heap_memory_usage | go, cgo | KiB |
   123  | cockroachdb.goroutines | goroutines | goroutines |
   124  | cockroachdb.gc_count | gc | invokes |
   125  | cockroachdb.gc_pause | pause | us |
   126  | cockroachdb.cgo_calls | cgo | calls |
   127  
   128  
   129  
   130  ## Alerts
   131  
   132  
   133  The following alerts are available:
   134  
   135  | Alert name  | On metric | Description |
   136  |:------------|:----------|:------------|
   137  | [ cockroachdb_used_storage_capacity ](https://github.com/netdata/netdata/blob/master/health/health.d/cockroachdb.conf) | cockroachdb.storage_used_capacity_percentage | storage capacity utilization |
   138  | [ cockroachdb_used_usable_storage_capacity ](https://github.com/netdata/netdata/blob/master/health/health.d/cockroachdb.conf) | cockroachdb.storage_used_capacity_percentage | storage usable space utilization |
   139  | [ cockroachdb_unavailable_ranges ](https://github.com/netdata/netdata/blob/master/health/health.d/cockroachdb.conf) | cockroachdb.ranges_replication_problem | number of ranges with fewer live replicas than needed for quorum |
   140  | [ cockroachdb_underreplicated_ranges ](https://github.com/netdata/netdata/blob/master/health/health.d/cockroachdb.conf) | cockroachdb.ranges_replication_problem | number of ranges with fewer live replicas than the replication target |
   141  | [ cockroachdb_open_file_descriptors_limit ](https://github.com/netdata/netdata/blob/master/health/health.d/cockroachdb.conf) | cockroachdb.process_file_descriptors | open file descriptors utilization (against softlimit) |
   142  
   143  
   144  ## Setup
   145  
   146  ### Prerequisites
   147  
   148  No action required.
   149  
   150  ### Configuration
   151  
   152  #### File
   153  
   154  The configuration file name for this integration is `go.d/cockroachdb.conf`.
   155  
   156  
   157  You can edit the configuration file using the `edit-config` script from the
   158  Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
   159  
   160  ```bash
   161  cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
   162  sudo ./edit-config go.d/cockroachdb.conf
   163  ```
   164  #### Options
   165  
   166  The following options can be defined globally: update_every, autodetection_retry.
   167  
   168  
   169  <details><summary>Config options</summary>
   170  
   171  | Name | Description | Default | Required |
   172  |:----|:-----------|:-------|:--------:|
   173  | update_every | Data collection frequency. | 10 | no |
   174  | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
   175  | url | Server URL. | http://127.0.0.1:8080/_status/vars | yes |
   176  | timeout | HTTP request timeout. | 1 | no |
   177  | username | Username for basic HTTP authentication. |  | no |
   178  | password | Password for basic HTTP authentication. |  | no |
   179  | proxy_url | Proxy URL. |  | no |
   180  | proxy_username | Username for proxy basic HTTP authentication. |  | no |
   181  | proxy_password | Password for proxy basic HTTP authentication. |  | no |
   182  | method | HTTP request method. | GET | no |
   183  | body | HTTP request body. |  | no |
   184  | headers | HTTP request headers. |  | no |
   185  | not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no |
   186  | tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no |
   187  | tls_ca | Certification authority that the client uses when verifying the server's certificates. |  | no |
   188  | tls_cert | Client TLS certificate. |  | no |
   189  | tls_key | Client TLS key. |  | no |
   190  
   191  </details>
   192  
   193  #### Examples
   194  
   195  ##### Basic
   196  
   197  An example configuration.
   198  
   199  <details><summary>Config</summary>
   200  
   201  ```yaml
   202  jobs:
   203    - name: local
   204      url: http://127.0.0.1:8080/_status/vars
   205  
   206  ```
   207  </details>
   208  
   209  ##### HTTP authentication
   210  
   211  Local server with basic HTTP authentication.
   212  
   213  <details><summary>Config</summary>
   214  
   215  ```yaml
   216  jobs:
   217    - name: local
   218      url: http://127.0.0.1:8080/_status/vars
   219      username: username
   220      password: password
   221  
   222  ```
   223  </details>
   224  
   225  ##### HTTPS with self-signed certificate
   226  
   227  CockroachDB with enabled HTTPS and self-signed certificate.
   228  
   229  <details><summary>Config</summary>
   230  
   231  ```yaml
   232  jobs:
   233    - name: local
   234      url: https://127.0.0.1:8080/_status/vars
   235      tls_skip_verify: yes
   236  
   237  ```
   238  </details>
   239  
   240  ##### Multi-instance
   241  
   242  > **Note**: When you define multiple jobs, their names must be unique.
   243  
   244  Collecting metrics from local and remote instances.
   245  
   246  
   247  <details><summary>Config</summary>
   248  
   249  ```yaml
   250  jobs:
   251    - name: local
   252      url: http://127.0.0.1:8080/_status/vars
   253  
   254    - name: remote
   255      url: http://203.0.113.10:8080/_status/vars
   256  
   257  ```
   258  </details>
   259  
   260  
   261  
   262  ## Troubleshooting
   263  
   264  ### Debug Mode
   265  
   266  To troubleshoot issues with the `cockroachdb` collector, run the `go.d.plugin` with the debug option enabled. The output
   267  should give you clues as to why the collector isn't working.
   268  
   269  - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
   270    your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
   271  
   272    ```bash
   273    cd /usr/libexec/netdata/plugins.d/
   274    ```
   275  
   276  - Switch to the `netdata` user.
   277  
   278    ```bash
   279    sudo -u netdata -s
   280    ```
   281  
   282  - Run the `go.d.plugin` to debug the collector:
   283  
   284    ```bash
   285    ./go.d.plugin -d -m cockroachdb
   286    ```
   287  
   288