Redis Integration
Monitor Redis memory pressure, command performance, keyspace behaviour, persistence, slow commands, replication and cluster health from a single Watchlog agent.
The agent runs redis-cli once per collection cycle and derives everything from that single round-trip.
Supported Platforms
Requirements
redis-cli 6.2 or newer is required
Advanced collection needs redis-cli with --json support, which arrived in Redis 6.2. The agent checks for it and reports clearly if it is missing, rather than silently collecting nothing.
This is the version of the client on the agent's host, not the server. An older redis-cli talking to a Redis 7 server still will not work.
redis-cli --version
| Requirement | Notes |
|---|---|
| Redis 5.0+ server | Tested against 5.x, 6.x and 7.x |
redis-cli 6.2+ on the agent's host | Must be on PATH |
| A user with read access | ACL user or the shared password |
Authentication
| Redis version | Configure |
|---|---|
| 6.0+ with ACLs | username and password |
5.x, or requirepass only | password alone |
| No auth | Leave both empty |
With ACLs, a read-only monitoring user is enough:
ACL SETUSER watchlog_monitor on >your_password ~* &* +@read +info +config|get +slowlog|get +client|list +cluster|info +cluster|nodes +replicaof|no
Or use the built-in read-only pattern if your policy prefers it. The commands Watchlog actually issues are INFO, INFO commandstats, SLOWLOG GET, CONFIG GET slowlog-*, CLUSTER INFO and CLUSTER NODES — nothing else.
What Watchlog Collects
Server and memory Version, mode, role, uptime, connected clients and blocked clients, used memory, peak memory, maxmemory and the eviction policy, RSS, memory fragmentation ratio, and Lua/script memory.
maxmemory = 0 means no limit
When maxmemory is 0, Redis has no configured ceiling. Watchlog reports memoryLimitConfigured: false and shows the usage without a percentage, rather than inventing a fake one against a limit that does not exist.
Commands (throttled — see intervals) Per command: calls, total and per-call microseconds, and rejected/failed counts where the server reports them. Ranked by total time consumed, so a cheap command called constantly ranks above a rare expensive one.
Keyspace Per database: keys, keys with a TTL, and average TTL. Plus cluster-wide keyspace hits and misses with the derived interval hit rate — not the since-boot ratio, which on a server up for months can no longer move.
Persistence RDB: last save time, changes since last save, last background save status and duration. AOF: enabled state, rewrite in progress, last rewrite status, current size and base size.
Slow commands From SLOWLOG GET: id, timestamp, duration, the command with arguments redacted, and the client address and name. The agent also reads CONFIG GET slowlog-* so the dashboard can tell you whether your configured threshold makes sense — it never writes that configuration.
Replication Role, connected replicas with their offsets and lag, master link status on a replica, and replication backlog state.
Cluster (when cluster mode is on) Cluster state, slots assigned / OK / PFAIL / FAIL, known nodes, cluster size, and per-node role and link state.
Health Score and Insights
A 0–100 score computed server-side, with a written reason on every deduction:
| Signal | Judged on |
|---|---|
| Memory pressure | Used against maxmemory — skipped entirely when no limit is configured |
| Fragmentation | RSS against used memory, which is what tells allocator waste from real growth |
| Swapping | Any swap usage, which Redis degrades sharply under |
| Cache hit rate | Interval hits against misses, not the lifetime ratio |
| Connection saturation | Clients against maxclients |
| Rejected connections | Connections Redis refused outright |
| Persistence | RDB save failures, AOF write failures, and stuck AOF rewrites |
| Replication | Link status, replica count, and lag |
| Cluster | State, failing slots, and incomplete slot coverage |
Insights add the interpretation: an eviction spike traced to a policy, a hit rate that dropped after a deploy, a replica that is connected but not streaming, and slot coverage that would make part of the keyspace unreachable.
Slow Commands
SLOWLOG is on by default in Redis, unlike MongoDB's profiler or Elasticsearch's slow logs — so this generally works with no server-side setup.
Watchlog reads it but never resets it. SLOWLOG RESET is destructive to anyone else reading the same log, so the agent tracks a high-water mark per instance instead: the same entry is never shipped twice, and never re-shipped after a restart.
Redis slowlog ids restart at 0 when the server restarts
The id alone is therefore not unique over time. Watchlog combines it with the server's run id so a replayed batch overwrites rather than duplicating.
Argument redaction
Command arguments are redacted on your host, before they leave it, and the rule is allow-list shaped rather than deny-list shaped — an argument is redacted unless it is provably safe to keep:
| Kept | Why |
|---|---|
| The command name | SET, HGETALL, ZRANGEBYSCORE — the diagnostic itself |
| Key names | Which key was slow is the whole point. Truncated if very long. |
| Numeric arguments | Range size is often the diagnosis — LRANGE key 0 -1 versus 0 10 |
| Structural tokens | LIMIT, WITHSCORES, MATCH, COUNT |
Everything else becomes [REDACTED]. A SET session:abc <token> stores the key and the command, never the value. RESTORE never ships its serialized payload.
Collection Intervals
| Section | Interval |
|---|---|
INFO, memory, clients, persistence, replication, cluster | every collection cycle (60s) |
| Command statistics | 60s, configurable via commandsIntervalSeconds |
| Slowlog | every cycle, from the high-water mark |
Safety
Watchlog is read-only. It never runs any of the following:
KEYS * · MONITOR · DEBUG SLEEP · FLUSHALL · FLUSHDB · CONFIG SET · SLOWLOG RESET · SCRIPT FLUSH · any write command
KEYS * and MONITOR deserve special mention: both are O(N) blocking operations that have taken down production Redis instances used exactly this way by other monitoring tools. Watchlog reads key counts from INFO keyspace, which is O(1).
Advanced Options
{
"service": "redis",
"monitor": true,
"host": "127.0.0.1",
"port": "6379",
"username": "",
"password": "your_password",
"db": "",
"tls": false,
"advanced": {
"enabled": true,
"commands": true,
"keyspace": true,
"replication": true,
"cluster": true,
"maxCommands": 200,
"commandsIntervalSeconds": 60
},
"slowlog": {
"enabled": true,
"limit": 128,
"maxPerScrape": 100
}
}
| Field | Default | Purpose |
|---|---|---|
username | (empty) | Redis 6+ ACL user. Leave empty for requirepass-only setups. |
db | (empty) | Database index to select. Rarely needed — INFO is server-wide. |
tls | false | Adds --tls to the redis-cli invocation |
advanced.commands | true | INFO commandstats, which is not part of the default INFO reply |
advanced.maxCommands | 200 | Command shapes kept per scrape, ranked by total time |
slowlog.enabled | true | Unlike other integrations, this is on by default — SLOWLOG is on by default in Redis |
slowlog.limit | 128 | How many entries to request per SLOWLOG GET |
Multiple Instances
Add one entry per instance. Each is identified by its host:port:
[
{
"service": "redis",
"monitor": true,
"host": "127.0.0.1",
"port": "6379",
"password": "your_password"
},
{
"service": "redis",
"monitor": true,
"host": "127.0.0.1",
"port": "6380",
"password": "your_password"
}
]
Troubleshooting
| Symptom | Cause |
|---|---|
Nothing collected, error mentions --json | redis-cli is older than 6.2, or is not on the agent's PATH |
| Commands tab empty | INFO commandstats is not in the default reply and needs advanced.commands; some managed providers also restrict it |
| Memory percentage missing | maxmemory is 0, so there is no limit to compute a percentage against. This is correct, not a bug. |
| Cluster tab missing | The server is not in cluster mode |
NOAUTH errors | A password is set on the server but not in the config |
WRONGPASS with a username | Redis 5 does not support ACL usernames — leave username empty and use password alone |
| Slowlog empty | slowlog-log-slower-than may be set very high, or -1 which disables it. The dashboard shows your configured threshold. |
