Skip to content

feat: N+1 detection, auto-instrumentation, diff, AI explain, and new exports#9

Merged
beingmartinbmc merged 2 commits into
mainfrom
feat/viral-features
Jun 24, 2026
Merged

feat: N+1 detection, auto-instrumentation, diff, AI explain, and new exports#9
beingmartinbmc merged 2 commits into
mainfrom
feat/viral-features

Conversation

@beingmartinbmc

Copy link
Copy Markdown
Owner

Summary

Adds a set of developer-experience features to node-request-trace and bumps the version to 2.3.0.

New features

  • N+1 / duplicate detection (lib/analysis.js) — groups semantically identical steps within a request.
  • Auto-instrumentation (lib/auto-instrument.js) — pg, mongodb, ioredis via autoInstrument; knex and Prisma via explicit instance helpers.
  • Trace diffing (lib/diff.js) — per-step deltas and regression flag.
  • AI explanations (lib/explain.js) — OpenAI-compatible endpoint, key supplied by user; offline prompt builder included.
  • New exports — Markdown, self-contained HTML snapshot, Speedscope (alongside existing Chrome trace).

Surface area

  • CLI: diff, markdown/md, snapshot, explain, speedscope.
  • HTTP: /trace/:id/speedscope, /trace/:id/markdown, /trace/:id/snapshot, /trace/diff/:a/:b.
  • Dashboard: N+1 warnings and export buttons.
  • README rewritten in a single consistent voice.

Testing

  • npm test — 251 passed, 0 failed.
  • npm run lint / npm run typecheck — pass.

No runtime dependencies added.

Set FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true at workflow level for both

ci.yml and release.yml to silence the actions/checkout@v4 +

actions/setup-node@v4 Node 20 deprecation warning.

Rename the 'Test with coverage' step to 'Test with coverage gate

(>=90%)' to make the threshold explicit. The threshold itself is

unchanged — it is enforced via npm run test:coverage which is c8

--check-coverage --lines 90 --functions 90 --branches 90 --statements

90.
…new exports

- N+1 and duplicate-work detection (lib/analysis.js)
- Auto-instrumentation for pg, mongodb, ioredis, knex, prisma (lib/auto-instrument.js)
- Trace diffing with regression detection (lib/diff.js)
- AI explanations via OpenAI-compatible endpoints (lib/explain.js)
- Markdown, shareable HTML snapshot, and Speedscope exports
- New CLI commands: diff, markdown/md, snapshot, explain, speedscope
- New HTTP endpoints: /speedscope, /markdown, /snapshot, /trace/diff/:a/:b
- Dashboard N+1 warnings and export buttons
- Rewrite README in a single consistent voice
- Bump version to 2.3.0
@beingmartinbmc beingmartinbmc merged commit 9a19c26 into main Jun 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant