Skip to main content

Redis Receiver

Status Available in: contrib Maintainers: @dmitryax, @hughesjj Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

Details

The Redis INFO command returns information and statistics about a Redis server (see https://redis.io/commands/info for details). The Redis receiver extracts values from the result and converts them to open telemetry metrics. Details about the metrics produced by the Redis receiver can be found by browsing metric_functions.go. For example, one of the fields returned by the Redis INFO command is used_cpu_sys which indicates the system CPU consumed by the Redis server, expressed in seconds, since the start of the Redis instance. The Redis receiver turns this data into a gauge…
func usedCPUSys() *redisMetric {
	return &redisMetric{
		key:    "used_cpu_sys",
		name:   "redis.cpu.time",
		units:  "s",
		mdType: metricspb.MetricDescriptor_GAUGE_DOUBLE,
		labels: map[string]string{"state": "sys"},
	}
}
with a metric name of redis.cpu.time and a units value of s (seconds).

Configuration

The following settings are required:
  • endpoint (no default): The hostname and port of the Redis instance, separated by a colon.
The following settings are optional:
  • collection_interval (default = 10s): This receiver runs on an interval. Each time it runs, it queries Redis, creates metrics, and sends them to the next consumer. The collection_interval configuration option tells this receiver the duration between runs. This value must be a string readable by Golang’s ParseDuration function (example: 1h30m). Valid time units are ns, us (or µs), ms, s, m, h.
  • username (no default): Client username used to connect to a Redis >=6.0 instance that is using the Redis ACL system.
  • password (no default): The password used to access the Redis instance; must match the password specified in the requirepass server configuration option in Redis <6.0. For Redis >=6.0, the user’s password when connecting using the Redis ACL system.
  • transport (default = tcp) Defines the network to use for connecting to the server. Valid Values are tcp or Unix
  • tls:
    • insecure (default = true): whether to disable client transport security for the exporter’s connection.
    • ca_file: path to the CA cert. For a client this verifies the server certificate. Should only be used if insecure is set to false.
    • cert_file: path to the TLS cert to use for TLS required connections. Should only be used if insecure is set to false.
    • key_file: path to the TLS key to use for TLS required connections. Should only be used if insecure is set to false.
Example:
receivers:
  redis:
    endpoint: "localhost:6379"
    collection_interval: 10s
    password: ${env:REDIS_PASSWORD}
:information_source: As with all Open Telemetry configuration values, a reference to an environment variable is supported. For example, to pick up the value of an environment variable REDIS_PASSWORD, you could use a configuration like the following:
receivers:
  redis:
    endpoint: "localhost:6379"
    collection_interval: 10s
    password: ${env:REDIS_PASSWORD}
The full list of settings exposed for this receiver are documented in config.go with detailed sample configurations in testdata/config.yaml.

Metrics

Metric NameDescriptionUnitTypeAttributes
redis.clients.blockedNumber of clients pending on a blocking call{client}UpDownCounter
redis.clients.connectedNumber of client connections (excluding connections from replicas){client}UpDownCounter
redis.clients.max_input_bufferBiggest input buffer among current client connectionsByGauge
redis.clients.max_output_bufferLongest output list among current client connectionsByGauge
redis.cluster.cluster_enabledIndicate Redis cluster is enabled1Gauge
redis.cluster.known_nodesNumber of known nodes in the cluster{node}Gauge
redis.cluster.links_buffer_limit_exceeded.countTotal number of times the cluster links buffer limit was exceeded{count}Counter
redis.cluster.node.countNumber of master nodes in the cluster{node}Gauge
redis.cluster.node.uptimeThe node’s current epochsGauge
redis.cluster.slots_assignedNumber of slots assigned in the cluster{slot}Gauge
redis.cluster.slots_failNumber of slots in the cluster that are in a failing state{slot}Gauge
redis.cluster.slots_okNumber of slots in the cluster that are ok{slot}Gauge
redis.cluster.slots_pfailNumber of slots in the cluster that are in a ‘potentially failing’ state{slot}Gauge
redis.cluster.stateState of the cluster{state}Gaugecluster_state
redis.cluster.stats_messages_receivedTotal number of messages received by the cluster{message}Counter
redis.cluster.stats_messages_sentTotal number of messages sent by the cluster{message}Counter
redis.cluster.uptimeCurrent epoch of the clustersGauge
redis.cmd.callsTotal number of calls for a command{call}Countercmd
redis.cmd.latencyCommand execution latencysGaugecmd, percentile
redis.cmd.usecTotal time for all executions of this commandusCountercmd
redis.commandsNumber of commands processed per second{ops}/sGauge
redis.commands.processedTotal number of commands processed by the server{command}Counter
redis.connections.receivedTotal number of connections accepted by the server{connection}Counter
redis.connections.rejectedNumber of connections rejected because of maxclients limit{connection}Counter
redis.cpu.timeSystem CPU consumed by the Redis server in seconds since server startsCounterstate
redis.db.avg_ttlAverage keyspace keys TTLmsGaugedb
redis.db.expiresNumber of keyspace keys with an expiration{key}Gaugedb
redis.db.keysNumber of keyspace keys{key}Gaugedb
redis.keys.evictedNumber of evicted keys due to maxmemory limit{key}Counter
redis.keys.expiredTotal number of key expiration events{event}Counter
redis.keyspace.hitsNumber of successful lookup of keys in the main dictionary{hit}Counter
redis.keyspace.missesNumber of failed lookup of keys in the main dictionary{miss}Counter
redis.latest_forkDuration of the latest fork operation in microsecondsusGauge
redis.maxmemoryThe value of the maxmemory configuration directiveByGauge
redis.memory.fragmentation_ratioRatio between used_memory_rss and used_memory1Gauge
redis.memory.luaNumber of bytes used by the Lua engineByGauge
redis.memory.peakPeak memory consumed by Redis (in bytes)ByGauge
redis.memory.rssNumber of bytes that Redis allocated as seen by the operating systemByGauge
redis.memory.usedTotal number of bytes allocated by Redis using its allocatorByGauge
redis.memory.used_memory_overheadThe sum in bytes of all overheads that the server allocated for managing its internal data structuresByUpDownCounter
redis.memory.used_memory_startupInitial amount of memory consumed by Redis at startup in bytesByUpDownCounter
redis.modeRedis server mode{mode}Gaugemode
redis.net.inputThe total number of bytes read from the networkByCounter
redis.net.outputThe total number of bytes written to the networkByCounter
redis.rdb.changes_since_last_saveNumber of changes since the last dump{change}UpDownCounter
redis.replication.backlog_first_byte_offsetThe master offset of the replication backlog bufferByGauge
redis.replication.offsetThe server’s current replication offsetByGauge
redis.replication.replica_offsetOffset for redis replicaByGauge
redis.roleRedis node’s role{role}UpDownCounterrole
redis.sentinel.mastersNumber of masters monitored by Sentinel.{master}Gauge
redis.sentinel.running_scriptsNumber of running Sentinel scripts.{script}Gauge
redis.sentinel.scripts_queue_lengthLength of Sentinel scripts queue.{script}Gauge
redis.sentinel.simulate_failure_flagsSimulated failure flags bitmask.{flag}Gauge
redis.sentinel.tilt_since_secondsDuration in seconds of current TILT, or -1 if not in TILT mode.sGauge
redis.sentinel.total_tiltTotal TILT occurrences since start.{event}Counter
redis.slaves.connectedNumber of connected replicas{replica}UpDownCounter
redis.tracking_total_keysNumber of keys being tracked by the server{key}UpDownCounter
redis.uptimeNumber of seconds since Redis server startsCounter

Attributes

Attribute NameDescriptionTypeValues
cluster_stateState of the clusterstringok, fail
cmdRedis command namestring
dbRedis database identifierstring
modeRedis server modestringcluster, sentinel, standalone
percentilePercentilestringp50, p99, p99.9
roleRedis node’s rolestringreplica, primary
stateRedis CPU usage statestringsys, sys_children, sys_main_thread, user, user_children, user_main_thread

Resource Attributes

Attribute NameDescriptionTypeEnabled
redis.versionRedis server’s version.string
server.addressRedis server’s addressstring
server.portRedis server’s portstring

Configuration

Example Configuration

redis:
  endpoint: "localhost:6379"
  username: "test"
  password: "test"
  collection_interval: 10s
  tls:
    insecure: true

Last generated: 2026-04-13