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

     1  <!--startmeta
     2  custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/redis/README.md"
     3  meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/redis/metadata.yaml"
     4  sidebar_label: "Redis"
     5  learn_status: "Published"
     6  learn_rel_path: "Data Collection/Databases"
     7  most_popular: True
     8  message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
     9  endmeta-->
    10  
    11  # Redis
    12  
    13  
    14  <img src="https://netdata.cloud/img/redis.svg" width="150"/>
    15  
    16  
    17  Plugin: go.d.plugin
    18  Module: redis
    19  
    20  <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
    21  
    22  ## Overview
    23  
    24  This collector monitors the health and performance of Redis servers and collects general statistics, CPU and memory consumption, replication information, command statistics, and more.
    25  
    26  
    27  It connects to the Redis instance via a TCP or UNIX socket and executes the following commands:
    28  
    29  - [INFO ALL](https://redis.io/commands/info)
    30  - [PING](https://redis.io/commands/ping/)
    31  
    32  
    33  This collector is supported on all platforms.
    34  
    35  This collector supports collecting metrics from multiple instances of this integration, including remote instances.
    36  
    37  
    38  ### Default Behavior
    39  
    40  #### Auto-Detection
    41  
    42  By default, it detects instances running on localhost by attempting to connect using known Redis TCP and UNIX sockets:
    43  
    44  - 127.0.0.1:6379
    45  - /tmp/redis.sock
    46  - /var/run/redis/redis.sock
    47  - /var/lib/redis/redis.sock
    48  
    49  
    50  #### Limits
    51  
    52  The default configuration for this integration does not impose any limits on data collection.
    53  
    54  #### Performance Impact
    55  
    56  The default configuration for this integration is not expected to impose a significant performance impact on the system.
    57  
    58  
    59  ## Metrics
    60  
    61  Metrics grouped by *scope*.
    62  
    63  The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
    64  
    65  
    66  
    67  ### Per Redis instance
    68  
    69  These metrics refer to the entire monitored application.
    70  
    71  This scope has no labels.
    72  
    73  Metrics:
    74  
    75  | Metric | Dimensions | Unit |
    76  |:------|:----------|:----|
    77  | redis.connections | accepted, rejected | connections/s |
    78  | redis.clients | connected, blocked, tracking, in_timeout_table | clients |
    79  | redis.ping_latency | min, max, avg | seconds |
    80  | redis.commands | processes | commands/s |
    81  | redis.keyspace_lookup_hit_rate | lookup_hit_rate | percentage |
    82  | redis.memory | max, used, rss, peak, dataset, lua, scripts | bytes |
    83  | redis.mem_fragmentation_ratio | mem_fragmentation | ratio |
    84  | redis.key_eviction_events | evicted | keys/s |
    85  | redis.net | received, sent | kilobits/s |
    86  | redis.rdb_changes | changes | operations |
    87  | redis.bgsave_now | current_bgsave_time | seconds |
    88  | redis.bgsave_health | last_bgsave | status |
    89  | redis.bgsave_last_rdb_save_since_time | last_bgsave_time | seconds |
    90  | redis.aof_file_size | current, base | bytes |
    91  | redis.commands_calls | a dimension per command | calls |
    92  | redis.commands_usec | a dimension per command | microseconds |
    93  | redis.commands_usec_per_sec | a dimension per command | microseconds/s |
    94  | redis.key_expiration_events | expired | keys/s |
    95  | redis.database_keys | a dimension per database | keys |
    96  | redis.database_expires_keys | a dimension per database | keys |
    97  | redis.connected_replicas | connected | replicas |
    98  | redis.master_link_status | up, down | status |
    99  | redis.master_last_io_since_time | time | seconds |
   100  | redis.master_link_down_since_time | time | seconds |
   101  | redis.uptime | uptime | seconds |
   102  
   103  
   104  
   105  ## Alerts
   106  
   107  
   108  The following alerts are available:
   109  
   110  | Alert name  | On metric | Description |
   111  |:------------|:----------|:------------|
   112  | [ redis_connections_rejected ](https://github.com/netdata/netdata/blob/master/health/health.d/redis.conf) | redis.connections | connections rejected because of maxclients limit in the last minute |
   113  | [ redis_bgsave_slow ](https://github.com/netdata/netdata/blob/master/health/health.d/redis.conf) | redis.bgsave_now | duration of the on-going RDB save operation |
   114  | [ redis_bgsave_broken ](https://github.com/netdata/netdata/blob/master/health/health.d/redis.conf) | redis.bgsave_health | status of the last RDB save operation (0: ok, 1: error) |
   115  | [ redis_master_link_down ](https://github.com/netdata/netdata/blob/master/health/health.d/redis.conf) | redis.master_link_down_since_time | time elapsed since the link between master and slave is down |
   116  
   117  
   118  ## Setup
   119  
   120  ### Prerequisites
   121  
   122  No action required.
   123  
   124  ### Configuration
   125  
   126  #### File
   127  
   128  The configuration file name for this integration is `go.d/redis.conf`.
   129  
   130  
   131  You can edit the configuration file using the `edit-config` script from the
   132  Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
   133  
   134  ```bash
   135  cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
   136  sudo ./edit-config go.d/redis.conf
   137  ```
   138  #### Options
   139  
   140  The following options can be defined globally: update_every, autodetection_retry.
   141  
   142  
   143  <details><summary>Config options</summary>
   144  
   145  | Name | Description | Default | Required |
   146  |:----|:-----------|:-------|:--------:|
   147  | update_every | Data collection frequency. | 5 | no |
   148  | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
   149  | address | Redis server address. | redis://@localhost:6379 | yes |
   150  | timeout | Dial (establishing new connections), read (socket reads) and write (socket writes) timeout in seconds. | 1 | no |
   151  | username | Username used for authentication. |  | no |
   152  | password | Password used for authentication. |  | no |
   153  | tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no |
   154  | tls_ca | Certificate authority that client use when verifying server certificates. |  | no |
   155  | tls_cert | Client tls certificate. |  | no |
   156  | tls_key | Client tls key. |  | no |
   157  
   158  </details>
   159  
   160  #### Examples
   161  
   162  ##### TCP socket
   163  
   164  An example configuration.
   165  
   166  <details><summary>Config</summary>
   167  
   168  ```yaml
   169  jobs:
   170    - name: local
   171      address: 'redis://@127.0.0.1:6379'
   172  
   173  ```
   174  </details>
   175  
   176  ##### Unix socket
   177  
   178  An example configuration.
   179  
   180  <details><summary>Config</summary>
   181  
   182  ```yaml
   183  jobs:
   184    - name: local
   185      address: 'unix://@/tmp/redis.sock'
   186  
   187  ```
   188  </details>
   189  
   190  ##### TCP socket with password
   191  
   192  An example configuration.
   193  
   194  <details><summary>Config</summary>
   195  
   196  ```yaml
   197  jobs:
   198    - name: local
   199      address: 'redis://:password@127.0.0.1:6379'
   200  
   201  ```
   202  </details>
   203  
   204  ##### Multi-instance
   205  
   206  > **Note**: When you define multiple jobs, their names must be unique.
   207  
   208  Local and remote instances.
   209  
   210  
   211  <details><summary>Config</summary>
   212  
   213  ```yaml
   214  jobs:
   215    - name: local
   216      address: 'redis://:password@127.0.0.1:6379'
   217  
   218    - name: remote
   219      address: 'redis://user:password@203.0.113.0:6379'
   220  
   221  ```
   222  </details>
   223  
   224  
   225  
   226  ## Troubleshooting
   227  
   228  ### Debug Mode
   229  
   230  To troubleshoot issues with the `redis` collector, run the `go.d.plugin` with the debug option enabled. The output
   231  should give you clues as to why the collector isn't working.
   232  
   233  - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
   234    your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
   235  
   236    ```bash
   237    cd /usr/libexec/netdata/plugins.d/
   238    ```
   239  
   240  - Switch to the `netdata` user.
   241  
   242    ```bash
   243    sudo -u netdata -s
   244    ```
   245  
   246  - Run the `go.d.plugin` to debug the collector:
   247  
   248    ```bash
   249    ./go.d.plugin -d -m redis
   250    ```
   251  
   252