Docs » Integrations Guide » Integrations Reference » Redis

../../_images/integrations_redis.png Redis πŸ”—

DESCRIPTION πŸ”—

This integration primarily consists of the Smart Agent monitor collectd/redis. Below is an overview of that monitor.

Smart Agent Monitor πŸ”—

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 slaves
  • Number of blocked clients
  • Number of keys stored (per database)
  • Uptime
  • Changes since last save
  • Replication delay (per slave)

Monitoring length of Redis lists πŸ”—

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 master or slave config.

Sample YAML configuration with list lengths:

monitors:
- type: collectd/redis
  host: 127.0.0.1
  port: 9100
  sendListLengths:
  - databaseIndex: 0
    keyPattern: 'mylist*'

Example Config πŸ”—

monitors:
- type: collectd/redis
  host: 127.0.0.1
  port: 9100

INSTALLATION πŸ”—

This integration is part of the SignalFx Smart Agent as the collectd/redis monitor. You should first deploy the Smart Agent to the same host as the service you want to monitor, and then continue with the configuration instructions below.

CONFIGURATION πŸ”—

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.

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*'

USAGE πŸ”—

Sample of built-in dashboard in SignalFx:

../../_images/dashboard_redis.png

METRICS πŸ”—

Metric Name Description Type
bytes.used_memory Number of bytes allocated by Redis gauge
bytes.used_memory_lua Number of bytes used by the Lua engine gauge
bytes.used_memory_peak Peak Number of bytes allocated by Redis gauge
bytes.used_memory_rss Number of bytes allocated by Redis as seen by the OS gauge
counter.commands_processed Total number of commands processed by the server cumulative
counter.connections_received Total number of connections accepted by the server cumulative
counter.evicted_keys Number of evicted keys due to maxmemory limit cumulative
counter.expired_keys Total number of key expiration events cumulative
counter.lru_clock Clock incrementing every minute, for LRU management cumulative
counter.rejected_connections Number of connections rejected because of maxclients limit cumulative
counter.total_net_input_bytes Total number of bytes inputted cumulative
counter.total_net_output_bytes Total number of bytes outputted cumulative
counter.used_cpu_sys System CPU consumed by the Redis server cumulative
counter.used_cpu_sys_children System CPU consumed by the background processes cumulative
counter.used_cpu_user User CPU consumed by the Redis server cumulative
counter.used_cpu_user_children User CPU consumed by the background processes cumulative
derive.keyspace_hits Number of successful lookup of keys in the main dictionary cumulative
derive.keyspace_misses Number of failed lookup of keys in the main dictionary cumulative
gauge.blocked_clients Number of clients pending on a blocking call gauge
gauge.changes_since_last_save Number of changes since the last dump gauge
gauge.client_biggest_input_buf Biggest input buffer among current client connections gauge
gauge.client_longest_output_list Longest output list among current client connections gauge
gauge.connected_clients Number of client connections (excluding connections from slaves) gauge
gauge.connected_slaves Number of connected slaves gauge
gauge.db0_avg_ttl The average time to live for all keys in redis gauge
gauge.db0_expires The total number of keys in redis that will expire gauge
gauge.db0_keys The total number of keys stored in redis gauge
gauge.instantaneous_ops_per_sec Number of commands processed per second gauge
gauge.key_llen Length of an list key gauge
gauge.latest_fork_usec Duration of the latest fork operation in microseconds gauge
gauge.master_last_io_seconds_ago Number of seconds since the last interaction with master gauge
gauge.master_repl_offset Master replication offset gauge
gauge.mem_fragmentation_ratio Ratio between used_memory_rss and used_memory gauge
gauge.rdb_bgsave_in_progress Flag indicating a RDB save is on-going gauge
gauge.repl_backlog_first_byte_offset Slave replication backlog offset gauge
gauge.slave_repl_offset Slave replication offset gauge
gauge.uptime_in_days Number of days up gauge
gauge.uptime_in_seconds Number of seconds up gauge

bytes.used_memory πŸ”—

gauge

Number of bytes allocated by Redis

bytes.used_memory_lua πŸ”—

gauge

Number of bytes used by the Lua engine

bytes.used_memory_peak πŸ”—

gauge

Peak Number of bytes allocated by Redis

bytes.used_memory_rss πŸ”—

gauge

Number of bytes allocated by Redis as seen by the OS

counter.commands_processed πŸ”—

cumulative

Total number of commands processed by the server

counter.connections_received πŸ”—

cumulative

Total number of connections accepted by the server

counter.evicted_keys πŸ”—

cumulative

Number of evicted keys due to maxmemory limit

counter.expired_keys πŸ”—

cumulative

Total number of key expiration events

counter.lru_clock πŸ”—

cumulative

Clock incrementing every minute, for LRU management

counter.rejected_connections πŸ”—

cumulative

Number of connections rejected because of maxclients limit

counter.total_net_input_bytes πŸ”—

cumulative

Total number of bytes inputted

counter.total_net_output_bytes πŸ”—

cumulative

Total number of bytes outputted

counter.used_cpu_sys πŸ”—

cumulative

System CPU consumed by the Redis server

counter.used_cpu_sys_children πŸ”—

cumulative

System CPU consumed by the background processes

counter.used_cpu_user πŸ”—

cumulative

User CPU consumed by the Redis server

counter.used_cpu_user_children πŸ”—

cumulative

User CPU consumed by the background processes

derive.keyspace_hits πŸ”—

cumulative

Number of successful lookup of keys in the main dictionary

derive.keyspace_misses πŸ”—

cumulative

Number of failed lookup of keys in the main dictionary

gauge.blocked_clients πŸ”—

gauge

Number of clients pending on a blocking call

gauge.changes_since_last_save πŸ”—

gauge

Number of changes since the last dump

gauge.client_biggest_input_buf πŸ”—

gauge

Biggest input buffer among current client connections

gauge.client_longest_output_list πŸ”—

gauge

Longest output list among current client connections

gauge.connected_clients πŸ”—

gauge

Number of client connections (excluding connections from slaves)

gauge.connected_slaves πŸ”—

gauge

Number of connected slaves

gauge.db0_avg_ttl πŸ”—

gauge

The average time to live for all keys in redis

gauge.db0_expires πŸ”—

gauge

The total number of keys in redis that will expire

gauge.db0_keys πŸ”—

gauge

The total number of keys stored in redis

gauge.instantaneous_ops_per_sec πŸ”—

gauge

Number of commands processed per second

gauge.key_llen πŸ”—

gauge

Length of an list key

gauge.latest_fork_usec πŸ”—

gauge

Duration of the latest fork operation in microseconds

gauge.master_last_io_seconds_ago πŸ”—

gauge

Number of seconds since the last interaction with master

gauge.master_repl_offset πŸ”—

gauge

Master replication offset

gauge.mem_fragmentation_ratio πŸ”—

gauge

Ratio between used_memory_rss and used_memory

gauge.rdb_bgsave_in_progress πŸ”—

gauge

Flag indicating a RDB save is on-going

gauge.repl_backlog_first_byte_offset πŸ”—

gauge

Slave replication backlog offset

gauge.slave_repl_offset πŸ”—

gauge

Slave replication offset

gauge.uptime_in_days πŸ”—

gauge

Number of days up

gauge.uptime_in_seconds πŸ”—

gauge

Number of seconds up

Metrics that are categorized as container/host (default) are in bold and italics in the list below.

These are the metrics available for this integration.

  • bytes.used_memory (gauge)
    Number of bytes allocated by Redis
  • bytes.used_memory_lua (gauge)
    Number of bytes used by the Lua engine
  • bytes.used_memory_peak (gauge)
    Peak Number of bytes allocated by Redis
  • bytes.used_memory_rss (gauge)
    Number of bytes allocated by Redis as seen by the OS
  • counter.commands_processed (cumulative)
    Total number of commands processed by the server
  • counter.connections_received (cumulative)
    Total number of connections accepted by the server
  • counter.evicted_keys (cumulative)
    Number of evicted keys due to maxmemory limit
  • counter.expired_keys (cumulative)
    Total number of key expiration events
  • counter.lru_clock (cumulative)
    Clock incrementing every minute, for LRU management
  • counter.rejected_connections (cumulative)
    Number of connections rejected because of maxclients limit
  • counter.total_net_input_bytes (cumulative)
    Total number of bytes inputted
  • counter.total_net_output_bytes (cumulative)
    Total number of bytes outputted
  • counter.used_cpu_sys (cumulative)
    System CPU consumed by the Redis server
  • counter.used_cpu_sys_children (cumulative)
    System CPU consumed by the background processes
  • counter.used_cpu_user (cumulative)
    User CPU consumed by the Redis server
  • counter.used_cpu_user_children (cumulative)
    User CPU consumed by the background processes
  • derive.keyspace_hits (cumulative)
    Number of successful lookup of keys in the main dictionary
  • derive.keyspace_misses (cumulative)
    Number of failed lookup of keys in the main dictionary
  • gauge.blocked_clients (gauge)
    Number of clients pending on a blocking call
  • gauge.changes_since_last_save (gauge)
    Number of changes since the last dump
  • gauge.client_biggest_input_buf (gauge)
    Biggest input buffer among current client connections
  • gauge.client_longest_output_list (gauge)
    Longest output list among current client connections
  • gauge.connected_clients (gauge)
    Number of client connections (excluding connections from slaves)
  • gauge.connected_slaves (gauge)
    Number of connected slaves
  • gauge.db0_avg_ttl (gauge)
    The average time to live for all keys in redis
  • gauge.db0_expires (gauge)
    The total number of keys in redis that will expire
  • gauge.db0_keys (gauge)
    The total number of keys stored in redis
  • gauge.instantaneous_ops_per_sec (gauge)
    Number of commands processed per second
  • gauge.key_llen (gauge)
    Length of an list key
  • gauge.latest_fork_usec (gauge)
    Duration of the latest fork operation in microseconds
  • gauge.master_last_io_seconds_ago (gauge)
    Number of seconds since the last interaction with master
  • gauge.master_repl_offset (gauge)
    Master replication offset
  • gauge.mem_fragmentation_ratio (gauge)
    Ratio between used_memory_rss and used_memory
  • gauge.rdb_bgsave_in_progress (gauge)
    Flag indicating a RDB save is on-going
  • gauge.repl_backlog_first_byte_offset (gauge)
    Slave replication backlog offset
  • gauge.slave_repl_offset (gauge)
    Slave replication offset
  • gauge.uptime_in_days (gauge)
    Number of days up
  • gauge.uptime_in_seconds (gauge)
    Number of seconds up

Non-default metrics (version 4.7.0+) πŸ”—

The following information applies to the agent version 4.7.0+ that has enableBuiltInFiltering: true set on the top level of the agent config.

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.

Legacy non-default metrics (version < 4.7.0) πŸ”—

The following information only applies to agent version older than 4.7.0. If you have a newer agent and have set enableBuiltInFiltering: true at the top level of your agent config, see the section above. See upgrade instructions in Old-style whitelist filtering.

If you have a reference to the whitelist.json in your agent’s top-level metricsToExclude config option, and you want to emit metrics that are not in that whitelist, then you need to add an item to the top-level metricsToInclude config option to override that whitelist (see Inclusion filtering. Or you can just copy the whitelist.json, modify it, and reference that in metricsToExclude.