How Didi’s Open‑Source Rdebug Enables Real‑Traffic Debugging for Backend Services
Rdebug, Didi’s open‑source real‑debugger, records live traffic and replays it locally, letting developers debug, test and develop micro‑service backends without deploying downstream dependencies, thereby boosting efficiency, cutting testing costs, and reducing production incidents.
Background
Micro‑service architectures split a monolithic application into many small services, increasing the number of services to maintain and the frequency of RPC calls. Maintaining a stable offline environment becomes costly, and writing unit tests that mock numerous downstream services is labor‑intensive and often fails to reflect real traffic.
Purpose of Rdebug
Rdebug (Real Debugger) records real production traffic and replays it locally, enabling rapid development, debugging, and testing without setting up downstream services. This improves developer productivity and helps safeguard code quality.
Key Features
Deploy only the module code locally; no need to build or run downstream services.
Local replay on macOS without remote server login.
Supports common protocols such as FastCGI, HTTP, Redis, Thrift, MySQL.
Fast replay speed—each replay completes in seconds.
Path Redirection
When online deployment paths differ from local paths, Rdebug can redirect paths via simple configuration, avoiding invasive code changes.
Time Offset
During replay, timestamps are automatically shifted to the recorded time point, ensuring time‑sensitive business logic behaves correctly.
File Mock
Rdebug can mock files by specifying a file path and its content, allowing configuration “re‑creation” by combining with the reporting feature.
Elastic Search
Traffic stored in Elasticsearch can be searched by URI, input/output keywords, downstream calls, etc., and replay can be driven by search results.
Xdebug Integration
Rdebug links with Xdebug so developers can set breakpoints and debug using real traffic, facilitating code inspection, issue diagnosis, and downstream response analysis.
Rich Reporting
Replay reports compare input, output, and results between online and offline runs. Downstream call reports list all calls with protocol, request content, matched responses, and similarity scores, highlighting exact matches, noise, missing, or new calls. Coverage reports generated via Xdebug show which code paths were executed.
For installation, usage instructions, and FAQs, refer to the official repository and documentation:
GitHub: https://github.com/didi/rdebug
Wiki: https://github.com/didi/rdebug/wiki
Documentation: https://github.com/didi/rdebug/blob/master/doc/DocList.md
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
