You can capture any kind of Redis metrics like:
- Memory used
- Commands processed per second
- Number of connected clients and slaves
- Number of blocked clients
- Number of keys stored (per database)
- Changes since last save
- Replication delay (per slave)
Redis Instances: Overview of data from all Redis instances.
Redis Instance: Focus on a single Redis instance.
REQUIREMENTS AND DEPENDENCIES
This plugin requires:
|Python plugin for collectd||(included with SignalFx collectd agent)|
If you are using the new Smart Agent, see the docs for the collectd/redis monitor for more information. The configuration documentation below may be helpful as well, but consult the Smart Agent repo's docs for the exact schema.
Download the redis-collectd-plugin Python module.
Modify the sample configuration file as described in Configuration, below.
Using the example configuration files 10-redis_master.conf or 10-redis_slave.conf as a guide, provide values for the configuration options listed below that make sense for your environment and allow you to connect to the Redis instance to be monitored.
|Instance||Nodename||The Module block identifies a Redis instance running in an specified host and port. The name for node is a canonical identifier which is used as plugin instance. It is limited to 64 characters in length.|
|Host||Hostname||The Host option is the hostname or IP-address where the Redis instance is running.|
|Port||Port||The Port option is the TCP port on which the Redis instance accepts connections. Either a service name of a port number may be given. Please note that numerical port numbers must be given as a string, too.|
|Auth||Password||Optionally specify a password to use for AUTH.|
|SendListLength||(DB Index) (Key pattern)||Specify a pattern of keys to lists for which to send their length as a metric. See below for more details.|
Note: Monitoring multiple Redis instances on one host
You can configure this plugin to monitor multiple Redis instances on the same machine by repeating the section, as in the following example:
<Plugin python> ModulePath "/opt/collectd_plugins" Import "redis_info" <Module redis_info> Host "127.0.0.1" Port 9100 Verbose true Instance "instance_9100" Redis_uptime_in_seconds "gauge" Redis_used_memory "bytes" Redis_used_memory_peak "bytes" </Module> <Module redis_info> Host "127.0.0.1" Port 9101 Verbose true Instance "instance_9101" Redis_uptime_in_seconds "gauge" Redis_used_memory "bytes" Redis_used_memory_peak "bytes" Redis_master_repl_offset "gauge" </Module> <Module redis_info> Host "127.0.0.1" Port 9102 Verbose true Instance "instance_9102" Redis_uptime_in_seconds "gauge" Redis_used_memory "bytes" Redis_used_memory_peak "bytes" Redis_slave_repl_offset "gauge" </Module> </Plugin>
Note: value of plugin_instance
In the example above, 3 redis instances on the same host listen on different ports and
Instance is used to supply a static value for the dimension
Instance was not specified, the value of
plugin_instance reported by collectd would contain the combination of
Port as follows:
- "plugin_instance" => "127.0.0.1:9100"
- "plugin_instance" => "127.0.0.1:9101"
- "plugin_instance" => "127.0.0.1:9102"
Sample of built-in dashboard in SignalFx:
Monitoring length of Redis lists
To monitor the length of list keys, the key and database index must be
specified in the config file. Specify keys in the config file in the form
SendListLength $db_index "$key_name".
$key_name can be a globbed pattern
* is supported), in which case all keys matching that glob will be
processed. Don't forget to surround the pattern with double quotes or else
Collectd will strip out the asterisks. If any keys match the glob that are not
lists, an error will be sent to the collectd logs.
Lengths will be reported to SignalFx under the metric
separate time series for each list.
KEYS command is used to match the globs so don't try and
match something that is very big, as this command is not highly optimized and
can block other commands from executing.
Note: To avoid duplication reporting, this should only be reported in one node. Keys can be defined in either the master or slave config.
<Plugin python> ModulePath "/opt/collectd_plugins" Import "redis_info" <Module redis_info> Host "127.0.0.1" Port 9100 # Matches "mylist1", "mylist-test", etc... Don't forget double quotes! SendListLength 0 "mylist*" SendListLength 0 "message-queue" Verbose true Instance "instance_9100" Redis_uptime_in_seconds "gauge" Redis_used_memory "bytes" Redis_used_memory_peak "bytes" </Module>
For documentation of the metrics and dimensions emitted by this plugin, click here.
This integration is released under the Apache 2.0 license. See LICENSE for more details.