Deterministic Debugging with Time-Travel Replay
Capture a failed environment state and replay it in an isolated sandbox. Reproduce the bug instead of guessing at it.
How to Debug with Time-Travel Replay
When a microservice fails in production or staging, traditional debugging is destructive or inconsistent — you change something to investigate, and now you can't tell whether the change broke it further. MicroStax Time-Travel Replay captures the failed state as an immutable Snapshot Closure, then lets you re-run it from that recorded state as many times as you want.
1. Capture the Failure State
You can trigger a snapshot manually via the CLI or configure it to trigger automatically on a service crash.
# Create a production-safe snapshot closure
microstax env snapshot --closure <env-id>
[!NOTE] Snapshot Closures include the container images, environment variables, and the exact state of persistent volumes at the moment of capture.
2. Replay the Recorded State
Once captured, you can "replay" the environment. Replay re-executes the snapshot's recorded execution graph against the environment, reproducing the state it captured.
Using the CLI
# Replay from the latest snapshot
microstax env replay <env-id>
# Replay from a specific snapshot ID
microstax env replay <env-id> --snapshot <snapshot-id>
Using the VS Code Extension
- Open the MicroStax Environments panel.
- Right-click the failed environment (or a specific snapshot node).
- Select MicroStax: Replay Snapshot.
3. Deterministic Root Cause Analysis
Because the replay reproduces the recorded state, you can:
- Attach Debuggers: Use standard
gdb,inspect, or VS Code debuggers without affecting production state. - Modify Code: Tweak the code in your branch environment to see if it fixes the replayed crash.
- Validate Fixes: Run the exact same traffic through the replayed environment to verify the remediation.
Why use Time-Travel Replay?
- Zero Impact: Debug the "crash" as many times as you want without touching live users.
- 100% Fidelity: No more "it works on my machine" issues. The replay runs from the exact recorded execution graph.
- Fast Troubleshooting: Skip the hours of database-seeding and environment-setup.
Next Steps
- Learn how to use Traffic Shadowing for proactive validation.
- Explore AI-Powered Diagnostics for automated fix suggestions.
- View the Full CLI Reference.