Repository navigation
fix(node): report NestJS controller exceptions + full request URL (#920, #921) - #927
Merged
Merged
Conversation
Collaborator
Author
|
QA (QA / Product Reliability): PASS for #920 / #921. CI green after tracking dist/nest.js. Local: lint, all workspace tests (incl. new tsc check against NestInterceptor/ArgumentsHost), build, dist matches. Prod run against the QA project with packed node 1.5.0 on a Nest 12 scaffold (nest build OK), 4 runs: /boom and /boom-async → 500 unchanged and reported (were 0/4); trackError+rethrow reported once; 404 HttpException unchanged and not reported; |
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.
Base branch: develop
Summary
Closes #920
Closes #921
uncaughtExceptionand were never reported.@telemetry-tracker/node1.5.0 addsTelemetryInterceptor(global interceptor: reports, then rethrows the same error so Nest's responses and user filters are unchanged; HTTP exceptions < 500 skipped by default, configurable viashouldReport) andcaptureNestException(err, host?)for custom@Catch()filters (covers guards/middleware). Context:source: "nestjs", method, path (query stripped),Controller.handler. No Nest/rxjs runtime dependency (structural types; genericinterceptsatisfiesNestInterceptor).middleware()now recordsreq.originalUrl, falling back toreq.url, so Nest middleware (forRoutes("*")) and mounted Express routers no longer log every request as/.req.url. Node 1.4.2 → 1.5.0 (PR fix(node): wait for in-flight handled errors in flush (#851) #860's planned 1.4.3 bump will need a rebase onto 1.5.x).How to test
packages/telemetry-node/src/nest.test.tsboots a real Nest 11 + Express app: sync and async controller throws → 500 body unchanged and one/ingest/errorwith context; 404NotFoundExceptionunchanged and not reported; 200 passthrough; Nest middleware$request.url=/qa/ok?x=1; plainreq.urlfallback;captureNestExceptionnever throws. Verified the 3 regression tests fail without the fix.pnpm testnow runstsc -p tsconfig.test.json(compile check:NestInterceptor/ArgumentsHostassignability).pnpm lint,pnpm test,pnpm -r run build, committed dist matches build: pass.nest buildOK, 4 runs:/boomand/boom-async→ 500 and reported (previously 0/4);/handled(trackError + rethrow) reported once (dedupe);/http404404 not reported;$request.url/identify?u=…(previously/?u=…); unhandledRejection still reported + exit. Read back via the dashboard errors API.Checklist
[Unreleased]Security / privacy
Error context records the path without the query string.
$request.urlnow carries the full original URL (as plain Express already did).