Skip to main content

Redis

Plugin: go.d.plugin Module: redis

Overview

This collector monitors the health and performance of Redis servers and collects general statistics, CPU and memory consumption, replication information, command statistics, and more.

It connects to the Redis instance via a TCP or UNIX socket and executes the following commands:

This collector is supported on all platforms.

This collector supports collecting metrics from multiple instances of this integration, including remote instances.

Default Behavior

Auto-Detection

By default, it detects instances running on localhost by attempting to connect using known Redis TCP and UNIX sockets:

  • 127.0.0.1:6379
  • /tmp/redis.sock
  • /var/run/redis/redis.sock
  • /var/lib/redis/redis.sock

Limits

The default configuration for this integration does not impose any limits on data collection.

Performance Impact

The default configuration for this integration is not expected to impose a significant performance impact on the system.

Metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

Per Redis instance

These metrics refer to the entire monitored application.

This scope has no labels.

Metrics:

MetricDimensionsUnit
redis.connectionsaccepted, rejectedconnections/s
redis.clientsconnected, blocked, tracking, in_timeout_tableclients
redis.ping_latencymin, max, avgseconds
redis.commandsprocessescommands/s
redis.keyspace_lookup_hit_ratelookup_hit_ratepercentage
redis.memorymax, used, rss, peak, dataset, lua, scriptsbytes
redis.mem_fragmentation_ratiomem_fragmentationratio
redis.key_eviction_eventsevictedkeys/s
redis.netreceived, sentkilobits/s
redis.rdb_changeschangesoperations
redis.bgsave_nowcurrent_bgsave_timeseconds
redis.bgsave_healthlast_bgsavestatus
redis.bgsave_last_rdb_save_since_timelast_bgsave_timeseconds
redis.aof_file_sizecurrent, basebytes
redis.commands_callsa dimension per commandcalls
redis.commands_useca dimension per commandmicroseconds
redis.commands_usec_per_seca dimension per commandmicroseconds/s
redis.key_expiration_eventsexpiredkeys/s
redis.database_keysa dimension per databasekeys
redis.database_expires_keysa dimension per databasekeys
redis.connected_replicasconnectedreplicas
redis.master_link_statusup, downstatus
redis.master_last_io_since_timetimeseconds
redis.master_link_down_since_timetimeseconds
redis.uptimeuptimeseconds

Alerts

The following alerts are available:

Alert nameOn metricDescription
redis_connections_rejected redis.connectionsconnections rejected because of maxclients limit in the last minute
redis_bgsave_slow redis.bgsave_nowduration of the on-going RDB save operation
redis_bgsave_broken redis.bgsave_healthstatus of the last RDB save operation (0: ok, 1: error)
redis_master_link_down redis.master_link_down_since_timetime elapsed since the link between master and slave is down

Setup

Prerequisites

No action required.

Configuration

File

The configuration file name for this integration is go.d/redis.conf.

You can edit the configuration file using the edit-config script from the Netdata config directory.

cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/redis.conf

Options

The following options can be defined globally: update_every, autodetection_retry.

Config options
NameDescriptionDefaultRequired
update_everyData collection frequency.5no
autodetection_retryRecheck interval in seconds. Zero means no recheck will be scheduled.0no
addressRedis server address.redis://@localhost:6379yes
timeoutDial (establishing new connections), read (socket reads) and write (socket writes) timeout in seconds.1no
usernameUsername used for authentication.no
passwordPassword used for authentication.no
tls_skip_verifyServer certificate chain and hostname validation policy. Controls whether the client performs this check.nono
tls_caCertificate authority that client use when verifying server certificates.no
tls_certClient tls certificate.no
tls_keyClient tls key.no

Examples

TCP socket

An example configuration.

Config
jobs:
- name: local
address: 'redis://@127.0.0.1:6379'

Unix socket

An example configuration.

Config
jobs:
- name: local
address: 'unix://@/tmp/redis.sock'

TCP socket with password

An example configuration.

Config
jobs:
- name: local
address: 'redis://:[email protected]:6379'

Multi-instance

Note: When you define multiple jobs, their names must be unique.

Local and remote instances.

Config
jobs:
- name: local
address: 'redis://:[email protected]:6379'

- name: remote
address: 'redis://user:[email protected]:6379'

Troubleshooting

Debug Mode

To troubleshoot issues with the redis collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
  • Switch to the netdata user.

    sudo -u netdata -s
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m redis

Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.