-
Notifications
You must be signed in to change notification settings - Fork 5
Create monitor.md #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Create monitor.md #111
Changes from 5 commits
f9f111c
3eece77
df726d3
414e4db
e14528c
bcb95d4
1567fab
3b0469e
b3f2eae
fd794be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: "MONITOR" | ||
nav_order: 110 | ||
description: > | ||
Allows to observe all requests processed by the database in real-time. | ||
parent: "Commands" | ||
--- | ||
|
||
# MONITOR | ||
|
||
Allows to observe all requests processed by the database in real-time. | ||
This feature is invaluable for debugging and understanding the sequence of operations occurring in the database. | ||
|
||
Usage: `MONITOR` | ||
|
||
## Example | ||
|
||
``` | ||
> MONITOR | ||
``` | ||
|
||
## Output | ||
|
||
```sh | ||
1673022405.123456 [0 127.0.0.1:6379] "GRAPH.QUERY" "MyGraph" "MATCH (n) return n" | ||
1673022405.123789 [0 127.0.0.1:6379] "GRAPH.DELETE" "MyGraph" | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This example isn't very clear:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Example
|
||
|
||
Each line includes the following: | ||
|
||
1. **Timestamp:** The precise time when the command was received. | ||
2. **Database Index:** The database number where the command was executed (e.g., `[0]`). | ||
3. **Client Info:** The IP address and port of the client that issued the command. | ||
4. **Command:** The exact command and its arguments. | ||
|
||
## Considerations | ||
|
||
- **Security:** Ensure `MONITOR` is used only by trusted users. It exposes all incoming commands, including potentially sensitive data. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure ? who's suppose to ensure that? and how exactly ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are things for |
||
- **Overhead:** `MONITOR` can slow down the database, especially under high load, due to the additional I/O required to stream the logs. | ||
gkorland marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **Connection Restriction:** Typically, `MONITOR` should be run from a dedicated connection. Mixing it with other commands can result in undefined behavior. | ||
|
||
## Terminating MONITOR | ||
|
||
To stop the `MONITOR` stream, simply close the client connection (e.g., terminate the session or disconnect the client tool). | ||
|
||
## Best Practices | ||
|
||
- Use `MONITOR` sparingly in production environments. | ||
- Combine `MONITOR` with logging or analysis tools for deeper insights. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shallow, unless we give recommendations for such tools. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I took it from Redis docs |
||
- Restrict access to users who require diagnostic capabilities, see: [ACL](/commands/acl) for more details. |
Uh oh!
There was an error while loading. Please reload this page.