Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Latest commit

 

History

History
180 lines (138 loc) · 8.63 KB

collectd-redis.md

File metadata and controls

180 lines (138 loc) · 8.63 KB

collectd/redis

Monitor Type: collectd/redis (Source)

Accepts Endpoints: Yes

Multiple Instances Allowed: Yes

Overview

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)

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

Example Config

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

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

Metrics

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 server
  • bytes.total_system_memory (gauge)
    Total memory available on the OS
  • 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 followers)
  • gauge.connected_slaves (gauge)
    Number of connected followers
  • 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 leader
  • gauge.master_link_down_since_seconds (gauge)
    Number of seconds since the link is down
  • gauge.master_link_status (gauge)
    Status of the link (up/down)
  • 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.rdb_last_save_time (gauge)
    Unix timestamp for last save to disk, when using persistence
  • 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+)

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.

Dimensions

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>.