Real-time log tracing is a lightweight request tracing feature that supports multi-dimensional filtering and automatic termination to quickly identify abnormal access behavior.
Overview
Use this feature for real-time diagnostics. You can configure rules to trace specific requests based on various filter conditions. Once enabled, the system generates detailed access logs for all matching requests. Key features include:
-
Real-time results: Tracing starts immediately and streams logs in real time.
-
Multi-dimensional filtering: Supports flexible combinations of conditions, such as command type, client IP, request size, or specific keys.
-
Run control: You can set a maximum duration (in seconds) or a log entry limit to automatically stop the tracing task.
-
Low overhead: The feature logs only requests that match your rules, resulting in significantly lower performance impact than the Audit Log feature.
Use cases
-
Identify sources of hot keys and large keys: Pinpoint which clients are accessing hot or large keys to optimize your caching strategies.
-
Trace abnormal commands: Quickly identify activities such as malicious scans or resource abuse.
This feature is intended for temporary, real-time diagnostics. For long-term auditing, we recommend using the Audit Log feature.
Version requirements
Your instance must be a memory-optimized Tair (Enterprise Edition) instance running minor version 25.10.1.0 or later.
Procedure
Log on to the DAS console.
In the navigation pane on the left, click .
Find the target instance and click the instance ID to open the instance details page.
-
In the left navigation pane, click Instance Sessions.
-
Click the Tracing Log tab, and then click Create Trace Rule.
NoteYou can have a maximum of five tracking rules.
-
In the panel that appears, configure the tracing and filtering rules.
In this example, to identify which clients are accessing the large key "bighash", configure the following parameters and leave the others at their default settings.
-
Rule Name: bighashKey.
-
Command Settings - Input: Enter
+@hash.NoteThe more specific the rule, the lower the overhead. For example,
+hsethas lower overhead than+@hash. -
Key Match: Select Key Pattern and enter bighash.
-
-
Click Create And Run.
The tracing task starts.
-
Refresh the Real-time Tracing Log list to view the request logs that match the rule. After the task runs, the Real-time Tracing Log page displays the matching results. In this example, the logs correspond to the rule named bighash Key. The log table includes columns for Time, Shard, Client IP address, Type, Request, Reply, and Engine latency. You can view details of HGET requests for the
bighashkey and the corresponding engine latency. Click View Details to expand the full reply.The tracing task ends automatically when any of the configured end conditions are met. You can then modify, delete, or re-run the tracing rule.
Warning-
Re-running a tracing rule deletes the original logs. To save the logs, export them beforehand.
-
Deleting a rule also deletes its corresponding logs.
-
Troubleshooting
Use the client IP and command behavior to troubleshoot your service logic or configure access control settings.