feat(debugging): add developer debugging toolkit#659
Merged
RUKAYAT-CODER merged 1 commit intoMay 27, 2026
Conversation
Implements an in-process debugging toolkit for developers: - Request/response inspection: DebugCaptureMiddleware records every exchange into a bounded in-memory ring buffer with header redaction and body truncation; exposed via GET /debug/requests[/:id]. - Request replay: RequestReplayService re-issues a captured request against the running instance (or a custom base URL) and diffs the response status; POST /debug/requests/:id/replay with header/body overrides for replacing redacted credentials. - Performance timeline: TimelineRecorder captures per-phase spans with high-resolution timing; PerformanceTimelineService surfaces slowest hotspots; GET /debug/requests/:id/timeline. - Stack trace enhancement: StackTraceService parses raw V8 stacks into structured frames, flags application vs node_module/internal frames, follows the error cause chain; GET /debug/requests/:id/trace. Capture middleware mounts only outside production (or DEBUG_CAPTURE=true) and excludes /debug/* to avoid recursion. Endpoints are admin-only. Wires DebuggingModule into AppModule.
|
@distributed-nerd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Kindly fix workflow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an in-process developer debugging toolkit (new module
src/debugging/) covering all acceptance criteria of the issue.DebugCaptureMiddlewarerecords every exchange into a bounded in-memory ring buffer (RequestCaptureService) with sensitive-header redaction and body truncation.GET /debug/requests,GET /debug/requests/:idRequestReplayServicere-issues a captured request against the running instance (or a custombaseUrl), supports header/body overrides for replacing redacted credentials, and diffs the response status.POST /debug/requests/:id/replayTimelineRecordercaptures per-phase spans with high-resolution timing;PerformanceTimelineService.hotspots()surfaces the slowest phases.GET /debug/requests/:id/timelineStackTraceServiceparses raw V8 stacks into structured frames, flags application vsnode_module/internal frames, and follows the errorcausechain.GET /debug/requests/:id/traceNotes
DEBUG_CAPTURE=true) and excludes/debug/*to avoid recursion.JwtAuthGuard+RolesGuard,UserRole.ADMIN).DebuggingModuleis wired intoAppModule. Seesrc/debugging/README.mdfor details.Closes #652