fix(next): thread redact through createInstrumentation().register()#442
Open
lichterspiel wants to merge 1 commit into
Open
fix(next): thread redact through createInstrumentation().register()#442lichterspiel wants to merge 1 commit into
lichterspiel wants to merge 1 commit into
Conversation
Contributor
|
@lichterspiel is attempting to deploy a commit to the HRCD Projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Thank you for following the naming conventions! 🙏 |
Contributor
📝 WalkthroughWalkthroughNext instrumentation now accepts ChangesNext instrumentation redaction
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
lichterspiel
force-pushed
the
fix/next-instrumentation-redact
branch
4 times, most recently
from
July 23, 2026 12:11
2da5f87 to
154b0f5
Compare
register() re-initialised the global logger without threading options.redact and then locked it, clobbering the redact config createEvlog applied at import — silently disabling redaction for the documented Next.js instrumentation setup. Next-only: the handler path (HugoRCD#409) and both nitro plugins already thread it. Adds the redact option to InstrumentationOptions (matching the handler path's raw pass-through; the logger resolves it internally) and a regression test on the initLogger spy.
lichterspiel
force-pushed
the
fix/next-instrumentation-redact
branch
from
July 23, 2026 12:12
154b0f5 to
274ae35
Compare
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.
🔗 Linked issue
Resolves #441
📚 Description
register()innext/instrumentation-create.tsre-initialises the global logger without threadingoptions.redactand then callslockLogger()— so with the documented Next.js setup (createEvlog({ redact })+ the instrumentation module loading at boot), redaction configured at import is silently wiped onceregister()runs, and errors reach drains unredacted.Next-only: the handler path threads
redactsince #409, and both nitro plugins pass it — this was the last init path missing it.Changes:
redactadded toInstrumentationOptions(sameboolean | RedactConfigshape asNextEvlogOptions; raw pass-through like the handler path — the logger resolves it internally).register()'sinitLoggercall.initLoggerspy (fails onmain).vitest run test/next/instrumentation.test.ts→ 24/24;pnpm --filter evlog run buildclean.📝 Checklist
Summary by CodeRabbit
New Features
redactoption (boolean or custom config).Bug Fixes
redactsettings were not honored during instrumentation registration, resulting in redaction being silently ignored.Tests