Dash イベントで発表された新しいサーバーレス、ネットワーク、RUM などの機能をぜひご確認ください! Dash イベントで発表された新機能!

Redis

Agent Check Agentチェック

Supported OS: Linux Mac OS Windows

このページは英語では対応しておりません。随時翻訳に取り組んでいます。翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください。

Overview

Whether you use Redis as a database, cache, or message queue, this integration helps you track problems with your Redis servers and the parts of your infrastructure that they serve. The Datadog Agent’s Redis check collects metrics related to performance, memory usage, blocked clients, slave connections, disk persistence, expired and evicted keys, and many more.

Setup

Installation

The Redis check is included in the Datadog Agent package, so you don’t need to install anything else on your Redis servers.

Configuration

Host

Follow the instructions below to configure this check for an Agent running on a host. For containerized environments, see the Containerized section.

Metric collection
  1. Edit the redisdb.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory. The following parameters may require updating. See the sample redisdb.d/conf.yaml for all available configuration options.

      init_config:
      instances:
        ## @param host - string - required
        ## Enter the host to connect to.
        - host: localhost
          ## @param port - integer - required
          ## Enter the port of the host to connect to.
          port: 6379
  2. Restart the Agent.

Log collection

Available for Agent >6.0

  1. Collecting logs is disabled by default in the Datadog Agent, enable it in your datadog.yaml file:

      logs_enabled: true
  2. Uncomment and edit this configuration block at the bottom of your redisdb.d/conf.yaml:

      logs:
          - type: file
            path: /var/log/redis_6379.log
            source: redis
            sourcecategory: database
            service: myapplication

    Change the path and service parameter values and configure them for your environment. See the sample redisdb.yaml for all available configuration options.

  3. Restart the Agent.

Containerized

For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.

Metric collection
ParameterValue
<INTEGRATION_NAME>redisdb
<INIT_CONFIG>blank or {}
<INSTANCE_CONFIG>
{“host”: “%%host%%”,
“port”:“6379”,
“password”:“%%env_REDIS_PASSWORD%%“}
Log collection

Available for Agent v6.5+

Collecting logs is disabled by default in the Datadog Agent. To enable it, see Docker log collection.

ParameterValue
<LOG_CONFIG>{"source": "redis", "service": "<YOUR_APP_NAME>"}

Validation

Run the Agent’s status subcommand and look for redisdb under the Checks section.

Data Collected

Metrics

redis.aof.buffer_length
(gauge)
Size of the AOF buffer.
Shown as byte
redis.aof.last_rewrite_time
(gauge)
Duration of the last AOF rewrite.
Shown as second
redis.aof.rewrite
(gauge)
Flag indicating a AOF rewrite operation is on-going.
redis.aof.size
(gauge)
AOF current file size (aof_current_size).
Shown as byte
redis.clients.biggest_input_buf
(gauge)
The biggest input buffer among current client connections.
redis.clients.blocked
(gauge)
The number of connections waiting on a blocking call.
Shown as connection
redis.clients.longest_output_list
(gauge)
The longest output list among current client connections.
redis.cpu.sys
(gauge)
System CPU consumed by the Redis server.
Shown as second
redis.cpu.sys_children
(gauge)
System CPU consumed by the background processes.
Shown as second
redis.cpu.user
(gauge)
User CPU consumed by the Redis server.
Shown as second
redis.cpu.user_children
(gauge)
User CPU consumed by the background processes.
Shown as second
redis.expires
(gauge)
The number of keys with an expiration.
Shown as key
redis.expires.percent
(gauge)
Percentage of total keys with an expiration.
Shown as percent
redis.info.latency_ms
(gauge)
The latency of the redis INFO command.
Shown as millisecond
redis.key.length
(gauge)
The number of elements in a given key, tagged by key, e.g. 'key:mykeyname'. Enable in Agent's redisdb.yaml with the keys option.
redis.keys
(gauge)
The total number of keys.
Shown as key
redis.keys.evicted
(gauge)
The total number of keys evicted due to the maxmemory limit.
Shown as key
redis.keys.expired
(gauge)
The total number of keys expired from the db.
Shown as key
redis.mem.fragmentation_ratio
(gauge)
Ratio between used_memory_rss and used_memory.
Shown as fraction
redis.mem.lua
(gauge)
Amount of memory used by the Lua engine.
Shown as byte
redis.mem.maxmemory
(gauge)
Maximum amount of memory allocated to the Redisdb system.
Shown as byte
redis.mem.peak
(gauge)
The peak amount of memory used by Redis.
Shown as byte
redis.mem.rss
(gauge)
Amount of memory that Redis allocated as seen by the os.
Shown as byte
redis.mem.used
(gauge)
Amount of memory allocated by Redis.
Shown as byte
redis.mem.startup
(gauge)
Amount of memory consumed by Redis at startup.
Shown as byte
redis.mem.overhead
(gauge)
Sum of all overheads allocated by Redis for managing its internal datastructures.
Shown as byte
redis.net.clients
(gauge)
The number of connected clients (excluding slaves).
Shown as connection
redis.net.commands
(gauge)
The number of commands processed by the server.
Shown as command
redis.net.commands.instantaneous_ops_per_sec
(gauge)
The number of commands processed by the server per second.
Shown as command
redis.net.rejected
(gauge)
The number of rejected connections.
Shown as connection
redis.net.slaves
(gauge)
The number of connected slaves.
Shown as connection
redis.perf.latest_fork_usec
(gauge)
The duration of the latest fork.
Shown as microsecond
redis.persist
(gauge)
The number of keys persisted (redis.keys - redis.expires).
Shown as key
redis.persist.percent
(gauge)
Percentage of total keys that are persisted.
Shown as percent
redis.pubsub.channels
(gauge)
The number of active pubsub channels.
redis.pubsub.patterns
(gauge)
The number of active pubsub patterns.
redis.rdb.bgsave
(gauge)
One if a bgsave is in progress and zero otherwise.
redis.rdb.changes_since_last
(gauge)
The number of changes since the last background save.
redis.rdb.last_bgsave_time
(gauge)
Duration of the last bg_save operation.
Shown as second
redis.replication.backlog_histlen
(gauge)
The amount of data in the backlog sync buffer.
Shown as byte
redis.replication.delay
(gauge)
The replication delay in offsets.
Shown as offset
redis.replication.last_io_seconds_ago
(gauge)
Amount of time since the last interaction with master.
Shown as second
redis.replication.master_link_down_since_seconds
(gauge)
Amount of time that the master link has been down.
Shown as second
redis.replication.master_repl_offset
(gauge)
The replication offset reported by the master.
Shown as offset
redis.replication.slave_repl_offset
(gauge)
The replication offset reported by the slave.
Shown as offset
redis.replication.sync
(gauge)
One if a sync is in progress and zero otherwise.
redis.replication.sync_left_bytes
(gauge)
Amount of data left before syncing is complete.
Shown as byte
redis.slowlog.micros.95percentile
(gauge)
The 95th percentile of the duration of queries reported in the slow log.
Shown as microsecond
redis.slowlog.micros.avg
(gauge)
The average duration of queries reported in the slow log.
Shown as microsecond
redis.slowlog.micros.count
(rate)
The rate of queries reported in the slow log.
Shown as query
redis.slowlog.micros.max
(gauge)
The maximum duration of queries reported in the slow log.
Shown as microsecond
redis.slowlog.micros.median
(gauge)
The median duration of queries reported in the slow log.
Shown as microsecond
redis.stats.keyspace_hits
(gauge)
The total number of successful lookups in the main db.
Shown as key
redis.stats.keyspace_misses
(gauge)
The total number of missed lookups in the main db.
Shown as key
redis.command.calls
(gauge)
The number of times a redis command has been called, tagged by 'command', e.g. 'command:append'. Enable in Agent's redisdb.yaml with the command_stats option.
redis.command.usec_per_call
(gauge)
The CPU time consumed per redis command call, tagged by 'command', e.g. 'command:append'. Enable in Agent's redisdb.yaml with the command_stats option.

Events

The Redis check does not include any events.

Service Checks

redis.can_connect:
Returns CRITICAL if the Agent cannot connect to Redis to collect metrics, otherwise returns OK.

redis.replication.master_link_status:
Returns CRITICAL if this Redis instance is unable to connect to its master instance, otherwise returns OK.

Troubleshooting

Agent cannot connect

    redisdb
    -------
      - instance #0 [ERROR]: 'Error 111 connecting to localhost:6379. Connection refused.'
      - Collected 0 metrics, 0 events & 1 service chec

Check that the connection info in redisdb.yaml is correct.

Agent cannot authenticate

    redisdb
    -------
      - instance #0 [ERROR]: 'NOAUTH Authentication required.'
      - Collected 0 metrics, 0 events & 1 service check

Configure a password in redisdb.yaml.

Further Reading

Additional helpful documentation, links, and articles:


Mistake in the docs? Feel free to contribute!