MONITOR to stream every command the server processes, as it happens, to the current connection.
The connection turns into a continuous feed and stops accepting other commands, so it must be a dedicated one; closing it is how you stop monitoring. Each line carries a timestamp, the client that sent the command, and the command with its arguments.
It is a debugging tool: it shows the traffic of all clients, arguments included, so it can expose sensitive data, and the added work costs the server throughput while it is running. Use it briefly and against non-production data where possible.
Syntax
Arguments
This command takes no arguments.Important points
- This is a connection-oriented command and is available over native Redis TCP, not the stateless REST endpoint.
- This command can expose administrative information or make a broad destructive change. Restrict it to trusted code paths.
- MONITOR changes the TCP connection into a continuous command stream. Use a dedicated connection and close it to stop monitoring.
Response
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples
TCP examples use the TLSREDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
Redis CLI
ioredis
ioredis
node-redis
node-redis
redis-py
redis-py
jedis
jedis
redis-rs
redis-rs