Add guides for error handling, rate limiting, testing patterns, and structured logging in Fiber v3#517
Conversation
…tructured logging in Fiber v3
There was a problem hiding this comment.
Code Review
This pull request introduces five new blog posts for Fiber v3, covering production-grade error handling, rate limiting, testing patterns, structured logging, and Express-style handler adapters. The review feedback identifies several technical improvements: updating the requestid retrieval to use the v3-specific helper function, fixing a potential nil pointer dereference in the custom AppError type, and ensuring that response bodies are closed in test helper functions to prevent resource leaks.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (3)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
WalkthroughFive new Fiber v3 documentation posts and repo tooling files were added, plus several small doc link fixes and two minor UI/text edits. No exported/public code entities were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Pull request overview
This PR adds new Fiber v3 blog posts intended to guide readers on production-focused topics (error handling, rate limiting, testing patterns, and structured logging), plus an additional post on Express-style handler compatibility.
Changes:
- Add production error-handling guide with custom error handler patterns and panic recovery notes.
- Add guides for rate limiting strategies, testing patterns with
app.Test(), and structured logging with Logger middleware. - Add an Express-style handlers post covering Fiber v3’s multi-signature handler adapter.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| blog/2026-04-12-fiber-v3-error-handling-production.md | New error-handling guide (custom handlers, domain errors, recover middleware). |
| blog/2026-04-13-fiber-v3-rate-limiting-guide.md | New rate-limiting guide (dynamic limits, sliding window, Redis storage, keying). |
| blog/2026-04-14-fiber-v3-testing-patterns.md | New testing guide (middleware chains, error handler tests, route group tests). |
| blog/2026-04-15-fiber-v3-structured-logging.md | New structured logging guide (formats, request IDs, skipping noise, integrations). |
| blog/2026-04-16-fiber-v3-express-style-handlers.md | New guide on Express-style handler signatures and router adapter behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
blog/2026-04-14-fiber-v3-testing-patterns.md (2)
148-148: Minor wording polish: hyphenate compound modifier.Line 148 reads more cleanly as “error-handling suite”.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@blog/2026-04-14-fiber-v3-testing-patterns.md` at line 148, Update the sentence that currently reads "error handling suite" to use the hyphenated compound modifier "error-handling suite" (the line beginning with "That last assertion" in the post); edit the markdown content so the phrase is replaced with "error-handling suite" to improve wording consistency.
70-77: Add proper error assertions to test examples.The file discards errors from
app.Test(),io.ReadAll(), andjson.NewDecoder().Decode()in multiple examples using_placeholder. In educational content, prefer explicit error handling withrequire.NoError(t, err)orassert.NoError(t, err)to model robust Go testing patterns.Also applies to: 100, 133–134, 190, 216, 220, 243, 266
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@blog/2026-04-14-fiber-v3-testing-patterns.md` around lines 70 - 77, Update the test examples to stop discarding errors from app.Test, io.ReadAll, and json.NewDecoder().Decode and assert they are nil; specifically, after calls to app.Test(req) capture the error value and call require.NoError(t, err) (or assert.NoError(t, err)) before inspecting resp.StatusCode, and likewise check errors returned by io.ReadAll(...) and json.NewDecoder(...).Decode(&v) with require.NoError/assert.NoError so each example (including the occurrences around app.Test, io.ReadAll, and json.NewDecoder().Decode) shows explicit error handling and fails the test on unexpected errors.blog/2026-04-16-fiber-v3-express-style-handlers.md (1)
11-13: Keep “adapter/adaptor” terminology consistent in prose.Line 11/13 uses “adapter” while Line 129/223 references “Adaptor”. Consider standardizing narrative text to one variant and keeping “Adaptor” only where it is the official page name/link label.
Also applies to: 129-129, 223-223
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@blog/2026-04-16-fiber-v3-express-style-handlers.md` around lines 11 - 13, The prose uses both "adapter" and "Adaptor" inconsistently; pick one casing for narrative text (prefer lowercase "adapter") and keep "Adaptor" only where it is an official name/link (e.g., the page title or anchor), then update all occurrences accordingly—search for the terms "adapter" and "Adaptor" and change narrative mentions (including the sentence referencing adapter.go and the surrounding paragraphs) to the chosen variant while leaving the official page name/link label "Adaptor" unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@blog/2026-04-14-fiber-v3-testing-patterns.md`:
- Line 148: Update the sentence that currently reads "error handling suite" to
use the hyphenated compound modifier "error-handling suite" (the line beginning
with "That last assertion" in the post); edit the markdown content so the phrase
is replaced with "error-handling suite" to improve wording consistency.
- Around line 70-77: Update the test examples to stop discarding errors from
app.Test, io.ReadAll, and json.NewDecoder().Decode and assert they are nil;
specifically, after calls to app.Test(req) capture the error value and call
require.NoError(t, err) (or assert.NoError(t, err)) before inspecting
resp.StatusCode, and likewise check errors returned by io.ReadAll(...) and
json.NewDecoder(...).Decode(&v) with require.NoError/assert.NoError so each
example (including the occurrences around app.Test, io.ReadAll, and
json.NewDecoder().Decode) shows explicit error handling and fails the test on
unexpected errors.
In `@blog/2026-04-16-fiber-v3-express-style-handlers.md`:
- Around line 11-13: The prose uses both "adapter" and "Adaptor" inconsistently;
pick one casing for narrative text (prefer lowercase "adapter") and keep
"Adaptor" only where it is an official name/link (e.g., the page title or
anchor), then update all occurrences accordingly—search for the terms "adapter"
and "Adaptor" and change narrative mentions (including the sentence referencing
adapter.go and the surrounding paragraphs) to the chosen variant while leaving
the official page name/link label "Adaptor" unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4a15b21a-3cad-4225-bda9-8f550270dd7c
📒 Files selected for processing (4)
blog/2026-04-12-fiber-v3-error-handling-production.mdblog/2026-04-13-fiber-v3-rate-limiting-guide.mdblog/2026-04-14-fiber-v3-testing-patterns.mdblog/2026-04-16-fiber-v3-express-style-handlers.md
✅ Files skipped from review due to trivial changes (1)
- blog/2026-04-12-fiber-v3-error-handling-production.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: deploy (docs, gofiber/docs, docs.gofiber.io)
🧰 Additional context used
🪛 LanguageTool
blog/2026-04-13-fiber-v3-rate-limiting-guide.md
[style] ~50-~50: To elevate your writing, try using an alternative expression here.
Context: ... simple use cases where exact precision does not matter. Use sliding windows for auth endpoints...
(MATTERS_RELEVANT)
[style] ~155-~155: Consider using a different verb to strengthen your wording.
Context: ...after": retryAfter, }) }, ``` This gives clients machine-readable information th...
(GIVE_INFORMATION)
blog/2026-04-14-fiber-v3-testing-patterns.md
[grammar] ~148-~148: Use a hyphen to join words.
Context: ...most important test in your entire error handling suite. It catches information l...
(QB_NEW_EN_HYPHEN)
[style] ~197-~197: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...iber.App`. This lets your tests use the exact same setup as your production code without d...
(EN_WORDINESS_PREMIUM_EXACT_SAME)
blog/2026-04-16-fiber-v3-express-style-handlers.md
[style] ~9-~9: Consider using a different adverb to strengthen your wording.
Context: .... It is that every HTTP handler follows a completely different convention. Express gives you...
(COMPLETELY_ENTIRELY)
[style] ~73-~73: To elevate your writing, try using an alternative expression here.
Context: ...ors differently, and understanding this matters for middleware: ```go // next() error ...
(MATTERS_RELEVANT)
[uncategorized] ~129-~129: Do not mix variants of the same word (‘adaptor’ and ‘adapter’) within a single text.
Context: ...articipate in the Fiber chain, use the Adaptor middleware instea...
(EN_WORD_COHERENCY)
[uncategorized] ~129-~129: Do not mix variants of the same word (‘adaptor’ and ‘adapter’) within a single text.
Context: ...Fiber chain, use the Adaptor middleware instead, which provides full bidirecti...
(EN_WORD_COHERENCY)
[uncategorized] ~223-~223: Do not mix variants of the same word (‘adaptor’ and ‘adapter’) within a single text.
Context: ...e Handlers](/api/app#route-handlers) - Adaptor Middleware - [Wha...
(EN_WORD_COHERENCY)
🔇 Additional comments (1)
blog/2026-04-13-fiber-v3-rate-limiting-guide.md (1)
17-253: Strong guide with practical production depth.Clear progression from defaults to advanced patterns, with solid operational guidance around proxy trust, distributed storage, and per-route policies.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Makefile`:
- Around line 40-41: The Makefile's markdown target currently runs a global
install via "npm install -g markdownlint-cli2" which mutates host state and can
fail; change the target to remove the global install line and invoke the linter
via npx instead (e.g., use "npx markdownlint-cli2 \"blog/**/*.md\"" in the
markdown target) so CI/dev shells don't require global permissions and the
command will run without adding a dependency to package.json.
In `@project-words.txt`:
- Line 28: The whitelist contains the non-standard word "thinked" in
project-words.txt; verify whether this was intentionally added to suppress
spell-check warnings for the external dev.to article title "re-thinked" or added
by mistake, and then either (a) add a short comment or accompanying
documentation stating that "thinked" is whitelisted solely to avoid flagging the
external article title "re-thinked", or (b) remove the "thinked" entry from
project-words.txt if it was inadvertent so the spell-checker uses the correct
"thought".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fec66bee-2a45-4066-bc43-e0f784a85c24
⛔ Files ignored due to path filters (2)
.cspell.jsonis excluded by!**/*.json.github/workflows/spell-check.ymlis excluded by!**/*.yml
📒 Files selected for processing (4)
Makefileproject-words.txtsrc/components/home/Features.module.scsssrc/theme/DocVersionBanner/index.tsx
✅ Files skipped from review due to trivial changes (2)
- src/components/home/Features.module.scss
- src/theme/DocVersionBanner/index.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: deploy (home, gofiber/website, gofiber.io)
- GitHub Check: deploy (docs, gofiber/docs, docs.gofiber.io)
- GitHub Check: cspell
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile
[warning] 53-53: Missing required phony target "all"
(minphony)
[warning] 53-53: Missing required phony target "test"
(minphony)
🪛 LanguageTool
project-words.txt
[duplication] ~1-~1: Possible typo: you repeated a word.
Context: gofiber fasthttp Fasthttp Prefork keyauth gorm GORM healthz ready...
(WORD_REPEAT_RULE)
[duplication] ~5-~5: Possible typo: you repeated a word.
Context: ...fiber fasthttp Fasthttp Prefork keyauth gorm GORM healthz readyz zerolog Zerolog fiberzap...
(WORD_REPEAT_RULE)
[duplication] ~9-~9: Possible typo: you repeated a word.
Context: ...refork keyauth gorm GORM healthz readyz zerolog Zerolog fiberzap fiberzerolog fasthttpadaptor v...
(WORD_REPEAT_RULE)
🔇 Additional comments (1)
Makefile (1)
30-30: No action needed. The custom dictionary is properly configured.The
project-words.txtfile is explicitly referenced in.cspell.jsonwith the correct path ("./project-words.txt") and included in thedictionariesarray. The configuration will be consumed and applied during the spell check.> Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Makefile`:
- Around line 42-44: The Makefile's lint target description is inconsistent: the
comment above the target mentions "spell + markdown" but the target named "lint"
runs spell, codespell, and markdown; update the comment/description line (the
text on the line before the .PHONY: lint and the lint target block) to
accurately reflect all invoked checks (e.g., "spell + codespell + markdown") so
the comment matches the commands executed by the lint target.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 99ce38c3-3959-4d70-8c8a-7fc6dfad354a
⛔ Files ignored due to path filters (1)
.github/workflows/spell-check.ymlis excluded by!**/*.yml
📒 Files selected for processing (1)
Makefile
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: deploy (docs, gofiber/docs, docs.gofiber.io)
- GitHub Check: deploy (home, gofiber/website, gofiber.io)
- GitHub Check: cspell
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile
[warning] 52-52: Missing required phony target "all"
(minphony)
[warning] 52-52: Missing required phony target "test"
(minphony)
🔇 Additional comments (1)
Makefile (1)
37-40: Good fix: markdown lint no longer mutates global environment.Using
npx markdownlint-cli2at Line 40 keeps this target CI/dev-shell friendly and avoids global npm installs.
Summary by CodeRabbit