Skip to content

Redis

The Redis integration reads server statistics with the collector’s redis receiver (the INFO command) and parses the Redis log file. Connecting it adds the Redis overview dashboard.

Use this page when you run Redis yourself. For Amazon ElastiCache, see AWS ElastiCache for Redis.

  • Redis newer than 3.0.
  • An otelcol-contrib collector, v0.88.0 or newer, where you can add config files and environment variables. See Integrations.
  • For metrics: the collector can connect to Redis as a client. If the server sets requirepass, you need that password.
  • For logs: the collector can read the Redis log file. Find it with redis-cli CONFIG GET logfile.
redis-metrics.yaml
receivers:
redis:
endpoint: ${env:REDIS_ENDPOINT}
password: ${env:REDIS_PASSWORD}
collection_interval: 60s
# tls:
# insecure: false
# ca_file: /etc/ssl/certs/ca-certificates.crt
metrics:
redis.maxmemory:
enabled: true
redis.cmd.latency:
enabled: true
processors:
# Adds host.name. Remove when the collector runs on another host.
resourcedetection/system:
detectors: ["system"]
system:
hostname_sources: ["os"]
exporters:
otlp/fusescope:
endpoint: ${env:OTLP_DESTINATION_ENDPOINT}
tls:
insecure: true
service:
pipelines:
metrics/redis:
receivers: [redis]
processors: [resourcedetection/system]
exporters: [otlp/fusescope]
Variable Example Description
REDIS_ENDPOINT localhost:6379 Redis host:port, reachable from the collector.
REDIS_PASSWORD The requirepass password. Leave empty when none is set.
OTLP_DESTINATION_ENDPOINT fusescope-collector.example.com:4317 FuseScope collector, OTLP gRPC.

Run the collector with --config redis-metrics.yaml --config redis-logs.yaml, as shown in Run the collector. Set insecure: false in the exporter when the FuseScope endpoint uses TLS.

  1. Open Integrations › Redis.
  2. Click Connect Redis, then I have already configured.
  3. Click Test Connection. The badge reads This integration is working properly once logs with source = redis or Redis metrics arrive. Until then it reads Listening for data….

Redis overview dashboard, with a host.name variable:

  • Command/s, Hits/s
  • Memory usage, RSS Memory, Fragmentation ratio
  • Eviction rate, Keyspace Keys
  • Clients blocked, Unsaved changes

No log pipelines and no alert rules. Parsing happens in the collector config; see Log pipelines for more.

Field Path Type
Timestamp timestamp timestamp
Severity Text severity_text string
Severity Number severity_number number
Process ID attributes.pid string
Process Role attributes.role string
Source attributes.source (redis) string

The most useful of the 31 metrics. The Data Collected tab lists them all.

Metric Type Unit Description
redis_commands Gauge ops/s Commands processed per second.
redis_commands_processed Sum number Total commands processed.
redis_cmd_latency Gauge s Command execution latency.
redis_keyspace_hits Sum number Successful key lookups.
redis_keyspace_misses Sum number Failed key lookups.
redis_db_keys Gauge number Keys in the keyspace.
redis_db_expires Gauge number Keys with an expiration.
redis_db_avg_ttl Gauge ms Average key TTL.
redis_keys_evicted Sum number Keys evicted by the maxmemory limit.
redis_keys_expired Sum number Key expiration events.
redis_memory_used Gauge Bytes Bytes allocated by Redis.
redis_memory_rss Gauge Bytes Bytes allocated as seen by the OS.
redis_memory_peak Gauge Bytes Peak memory.
redis_memory_fragmentation_ratio Gauge number RSS divided by used memory.
redis_maxmemory Gauge Bytes The maxmemory setting.
redis_clients_connected Sum number Client connections, excluding replicas.
redis_clients_blocked Sum number Clients waiting on a blocking call.
redis_connections_rejected Sum number Connections rejected by maxclients.
redis_net_input Sum Bytes Bytes read from the network.
redis_net_output Sum Bytes Bytes written to the network.
redis_rdb_changes_since_last_save Sum number Changes since the last dump.
redis_slaves_connected Sum number Connected replicas.
redis_uptime Sum s Seconds since server start.