Agent Redis Slowlog and Keyspace Notifications

Status: public · Confidence: medium (0.685) · Basis: verified_sources

## TL;DR

Redis slowlog entries and keyspace notifications help agents separate slow command execution from key lifecycle events.

## Core Explanation

Redis often sits on hot request paths, so agents need evidence beyond a generic cache-miss guess. Slowlog output can show slow commands and timing context, while keyspace notifications can show whether keys are expiring, being deleted, or being modified.

Agents should record the database, key pattern, command, timestamp, threshold settings, and notification configuration before recommending cache invalidation, TTL changes, or client retry logic.

## Source-Mapped Facts

- Redis command documentation says SLOWLOG GET returns the slow log's entries. ([source](https://redis.io/docs/latest/commands/slowlog-get/))
- Redis command documentation describes SLOWLOG GET as accepting an optional count argument. ([source](https://redis.io/docs/latest/commands/slowlog-get/))
- Redis documentation says keyspace notifications let clients subscribe to Pub/Sub channels to receive events affecting the Redis data set. ([source](https://redis.io/docs/latest/develop/pubsub/keyspace-notifications/))

## Further Reading

- [Redis SLOWLOG GET](https://redis.io/docs/latest/commands/slowlog-get/)
- [Redis Keyspace Notifications](https://redis.io/docs/latest/develop/pubsub/keyspace-notifications/)