Skip to content

Add guides for error handling, rate limiting, testing patterns, and structured logging in Fiber v3#517

Merged
ReneWerner87 merged 10 commits intomasterfrom
more-blog-entries
Apr 13, 2026
Merged

Add guides for error handling, rate limiting, testing patterns, and structured logging in Fiber v3#517
ReneWerner87 merged 10 commits intomasterfrom
more-blog-entries

Conversation

@ReneWerner87
Copy link
Copy Markdown
Member

@ReneWerner87 ReneWerner87 commented Apr 12, 2026

Summary by CodeRabbit

  • Documentation
    • Added several production-focused Fiber v3 guides: error-handling with sanitized client responses and panic recovery, rate-limiting patterns (dynamic limits, windowing, distributed backend), testing patterns for middleware and error handlers, structured logging, and handler-style compatibility/migration.
  • Chores
    • Added Makefile targets for common workflows and quality checks; added project wordlist for tooling.
  • Style
    • Minor copy and wording fixes in UI text and CSS comments.

Copilot AI review requested due to automatic review settings April 12, 2026 18:07
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2fd6f74a-00c3-4d52-bcb7-ac8af2fb1353

📥 Commits

Reviewing files that changed from the base of the PR and between d88cc53 and afe821f.

📒 Files selected for processing (3)
  • blog/2026-02-11-whats-new-in-fiber-v3.md
  • blog/2026-02-12-build-a-crud-app-with-fiber.md
  • blog/2026-02-14-spa-delivery-with-fiber-v3.md
✅ Files skipped from review due to trivial changes (3)
  • blog/2026-02-14-spa-delivery-with-fiber-v3.md
  • blog/2026-02-11-whats-new-in-fiber-v3.md
  • blog/2026-02-12-build-a-crud-app-with-fiber.md
📜 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)
  • GitHub Check: cspell
  • GitHub Check: deploy (docs, gofiber/docs, docs.gofiber.io)
  • GitHub Check: deploy (home, gofiber/website, gofiber.io)

Walkthrough

Five 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

Cohort / File(s) Summary
New Fiber v3 Blog Posts
blog/2026-04-12-fiber-v3-error-handling-production.md, blog/2026-04-13-fiber-v3-rate-limiting-guide.md, blog/2026-04-14-fiber-v3-testing-patterns.md, blog/2026-04-15-fiber-v3-structured-logging.md, blog/2026-04-16-fiber-v3-express-style-handlers.md
Added five long-form guides covering: production error handling (sanitized JSON, AppError, panic recovery, validation responses, content negotiation), rate limiting (limiter config, algorithms, Redis backend, per-route limits), testing patterns with app.Test(), structured logging (JSON/ECS, request IDs, adapters), and Express-style handler signatures/migration.
Repository tooling
Makefile
New Makefile with lifecycle/dev targets and quality targets: help, install, dev, build, serve, spell, codespell, markdown, lint, format, clean.
Project wordlist
project-words.txt
Added curated word list for spell/check tooling and project-specific terms.
Documentation link updates
blog/2026-02-11-whats-new-in-fiber-v3.md, blog/2026-02-12-build-a-crud-app-with-fiber.md, blog/2026-02-14-spa-delivery-with-fiber-v3.md
Replaced absolute /blog/... links with relative versioned Markdown paths and fixed a few intra-doc anchors.
Minor UI / styles
src/components/home/Features.module.scss, src/theme/DocVersionBanner/index.tsx
Non-functional text edits: SCSS header comment language changed to English; fixed wording from “current choosen version” to “current chosen version”.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I nibble docs at early light,
I stitch errors safe and tight,
I count the hops and pace the rate,
I test the paths and log the gait,
A little carrot for each new write 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, but the repository's description template explicitly states that documentation PRs should not be submitted to this repository. This PR updates documentation files in the docs repository. Per the repository policy, submit documentation PRs to https://github.com/gofiber/fiber instead.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: five new blog posts covering error handling, rate limiting, testing patterns, structured logging, and Express-style handlers, plus tooling improvements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch more-blog-entries

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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(), and json.NewDecoder().Decode() in multiple examples using _ placeholder. In educational content, prefer explicit error handling with require.NoError(t, err) or assert.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

📥 Commits

Reviewing files that changed from the base of the PR and between dc1cf0d and 0141af0.

📒 Files selected for processing (4)
  • blog/2026-04-12-fiber-v3-error-handling-production.md
  • blog/2026-04-13-fiber-v3-rate-limiting-guide.md
  • blog/2026-04-14-fiber-v3-testing-patterns.md
  • blog/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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0141af0 and 0921262.

⛔ Files ignored due to path filters (2)
  • .cspell.json is excluded by !**/*.json
  • .github/workflows/spell-check.yml is excluded by !**/*.yml
📒 Files selected for processing (4)
  • Makefile
  • project-words.txt
  • src/components/home/Features.module.scss
  • src/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.txt file is explicitly referenced in .cspell.json with the correct path ("./project-words.txt") and included in the dictionaries array. The configuration will be consumed and applied during the spell check.

			> Likely an incorrect or invalid review comment.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0921262 and d88cc53.

⛔ Files ignored due to path filters (1)
  • .github/workflows/spell-check.yml is 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-cli2 at Line 40 keeps this target CI/dev-shell friendly and avoids global npm installs.

@ReneWerner87 ReneWerner87 merged commit 7573d7c into master Apr 13, 2026
6 checks passed
@ReneWerner87 ReneWerner87 deleted the more-blog-entries branch April 13, 2026 08:11
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.

2 participants