Monitor Type: collectd/redis
(Source)
Accepts Endpoints: Yes
Multiple Instances Allowed: Yes
Monitors a redis instance using the collectd Python Redis plugin. Supports Redis 2.8 and later.
You can capture any kind of Redis metrics like:
- Memory used
- Commands processed per second
- Number of connected clients and followers
- Number of blocked clients
- Number of keys stored (per database)
- Uptime
- Changes since last save
- Replication delay (per follower)
To monitor the length of list keys, the key and database index must be
specified in the config. Specify keys in the config file in the form
sendListLengths: [{databaseIndex: $db_index, keyPattern: "$key_name"}]
.
$key_name
can be a globbed pattern (only *
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 the asterisks might be
misinterpreted. 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 gauge.key_llen
, a
separate time series for each list.
Warning: The 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 leader or follower config.
Sample YAML configuration with list lengths:
monitors:
- type: collectd/redis
host: 127.0.0.1
port: 9100
sendListLengths:
- databaseIndex: 0
keyPattern: 'mylist*'
monitors:
- type: collectd/redis
host: 127.0.0.1
port: 9100
To activate this monitor in the Smart Agent, add the following to your agent config:
monitors: # All monitor config goes under this key
- type: collectd/redis
... # Additional config
For a list of monitor options that are common to all monitors, see Common Configuration.
Config option | Required | Type | Description |
---|---|---|---|
pythonBinary |
no | string |
Path to a python binary that should be used to execute the Python code. If not set, a built-in runtime will be used. Can include arguments to the binary as well. |
host |
yes | string |
|
port |
yes | integer |
|
name |
no | string |
The name for the node is a canonical identifier which is used as plugin instance. It is limited to 64 characters in length. (default: "{host}:{port}") |
auth |
no | string |
Password to use for authentication. |
sendListLengths |
no | list of objects (see below) |
Specify a pattern of keys to lists for which to send their length as a metric. See below for more details. |
verbose |
no | bool |
If true , verbose logging from the plugin will be enabled. (default: false ) |
The nested sendListLengths
config object has the following fields:
Config option | Required | Type | Description |
---|---|---|---|
databaseIndex |
yes | integer |
The database index. |
keyPattern |
yes | string |
Can be a globbed pattern (only * is supported), in which case all keys matching that glob will be processed. The pattern should be placed in single quotes ('). Ex. 'mylist*' |
These are the metrics available for this monitor. Metrics that are categorized as container/host (default) are in bold and italics in the list below.
bytes.maxmemory
(gauge)
Maximum memory configured on Redis serverbytes.total_system_memory
(gauge)
Total memory available on the OSbytes.used_memory
(gauge)
Number of bytes allocated by Redisbytes.used_memory_lua
(gauge)
Number of bytes used by the Lua enginebytes.used_memory_peak
(gauge)
Peak Number of bytes allocated by Redisbytes.used_memory_rss
(gauge)
Number of bytes allocated by Redis as seen by the OScounter.commands_processed
(cumulative)
Total number of commands processed by the servercounter.connections_received
(cumulative)
Total number of connections accepted by the servercounter.evicted_keys
(cumulative)
Number of evicted keys due to maxmemory limitcounter.expired_keys
(cumulative)
Total number of key expiration eventscounter.lru_clock
(cumulative)
Clock incrementing every minute, for LRU managementcounter.rejected_connections
(cumulative)
Number of connections rejected because of maxclients limitcounter.total_net_input_bytes
(cumulative)
Total number of bytes inputtedcounter.total_net_output_bytes
(cumulative)
Total number of bytes outputtedcounter.used_cpu_sys
(cumulative)
System CPU consumed by the Redis servercounter.used_cpu_sys_children
(cumulative)
System CPU consumed by the background processescounter.used_cpu_user
(cumulative)
User CPU consumed by the Redis servercounter.used_cpu_user_children
(cumulative)
User CPU consumed by the background processesderive.keyspace_hits
(cumulative)
Number of successful lookup of keys in the main dictionaryderive.keyspace_misses
(cumulative)
Number of failed lookup of keys in the main dictionarygauge.blocked_clients
(gauge)
Number of clients pending on a blocking callgauge.changes_since_last_save
(gauge)
Number of changes since the last dumpgauge.client_biggest_input_buf
(gauge)
Biggest input buffer among current client connectionsgauge.client_longest_output_list
(gauge)
Longest output list among current client connectionsgauge.connected_clients
(gauge)
Number of client connections (excluding connections from followers)gauge.connected_slaves
(gauge)
Number of connected followersgauge.db0_avg_ttl
(gauge)
The average time to live for all keys in redisgauge.db0_expires
(gauge)
The total number of keys in redis that will expiregauge.db0_keys
(gauge)
The total number of keys stored in redisgauge.instantaneous_ops_per_sec
(gauge)
Number of commands processed per secondgauge.key_llen
(gauge)
Length of an list keygauge.latest_fork_usec
(gauge)
Duration of the latest fork operation in microsecondsgauge.master_last_io_seconds_ago
(gauge)
Number of seconds since the last interaction with leadergauge.master_link_down_since_seconds
(gauge)
Number of seconds since the link is downgauge.master_link_status
(gauge)
Status of the link (up/down)gauge.master_repl_offset
(gauge)
Master replication offsetgauge.mem_fragmentation_ratio
(gauge)
Ratio between used_memory_rss and used_memorygauge.rdb_bgsave_in_progress
(gauge)
Flag indicating a RDB save is on-goinggauge.rdb_last_save_time
(gauge)
Unix timestamp for last save to disk, when using persistencegauge.repl_backlog_first_byte_offset
(gauge)
Slave replication backlog offsetgauge.slave_repl_offset
(gauge)
Slave replication offsetgauge.uptime_in_days
(gauge)
Number of days upgauge.uptime_in_seconds
(gauge)
Number of seconds up
To emit metrics that are not default, you can add those metrics in the
generic monitor-level extraMetrics
config option. Metrics that are derived
from specific configuration options that do not appear in the above list of
metrics do not need to be added to extraMetrics
.
To see a list of metrics that will be emitted you can run agent-status monitors
after configuring this monitor in a running agent instance.
The following dimensions may occur on metrics emitted by this monitor. Some dimensions may be specific to certain metrics.
Name | Description |
---|---|
plugin_instance |
Identifies the Redis instance -- will be of the form <host>_<port> . |