feat: v2 enhancements — auto instrumentation, HTTP tracing, flamegraph UI, CLI, Chrome export#1
Merged
beingmartinbmc merged 1 commit intomainfrom Mar 8, 2026
Merged
Conversation
1. Automatic Middleware Instrumentation - Express autoTrack (existing, enhanced) - Fastify lifecycle phase timing (onRequest, preParsing, preValidation, handler, onSend) - Koa instrumentKoa(app) patches app.use() to auto-wrap middleware 2. HTTP Client Tracing - Auto-instrument http.request, http.get, https.request, https.get, fetch - Records outgoing calls as steps with type 'http-outgoing' - Enable via traceOutgoing config or enableHttpTracing()/disableHttpTracing() 3. Timeline / Flamegraph UI - Waterfall view (default) - bars proportional to duration - Timeline view - time-proportional positioning - Flamegraph view - compact stacked blocks - Chrome Trace export button in detail panel 4. CLI Tool (npx node-request-trace) - stats, recent, slow, inspect, tail, export commands - ANSI colored terminal output with waterfall bars and flamegraph 5. Chrome Trace Export - /trace/:id/chrome HTTP endpoint - exportChromeTrace() and exportChromeTraceJson() API methods - Compatible with chrome://tracing Tests: 178 passing, 100% coverage across all files README: fully updated with all new features and examples
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
Five major features added to node-request-trace:
1. Automatic Middleware Instrumentation
autoTrackwraps middleware layers with timingonRequest,preParsing,preValidation,handler,onSend)trace.instrumentKoa(app)patchesapp.use()to auto-wrap each middleware2. HTTP Client Tracing
http.request,http.get,https.request,https.get,globalThis.fetchtype: 'http-outgoing'traceOutgoing: trueconfig orenableHttpTracing()/disableHttpTracing()3. Timeline / Flamegraph UI
4. CLI Tool (
npx node-request-trace)stats,recent,slow,inspect,tail,export5. Chrome Trace Export
GET /trace/:id/chromeHTTP endpointexportChromeTrace()andexportChromeTraceJson()API methodschrome://tracingTesting