Skip to content

docs: fix unsafe Fiber monitor integration example#3

Merged
gofurry merged 1 commit into
mainfrom
dev
Jun 25, 2026
Merged

docs: fix unsafe Fiber monitor integration example#3
gofurry merged 1 commit into
mainfrom
dev

Conversation

@gofurry

@gofurry gofurry commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

This PR fixes the Fiber integration documentation for monitor.

The previous README example called monitor.New inside Fiber's adaptor.HTTPMiddleware factory. Fiber executes that factory for every request, while each monitor instance starts one background collector goroutine. Copying that example could therefore create one collector goroutine per request.

Changes

  • Update the English README Fiber section with a safe startup-time monitor instance example.
  • Update the Simplified Chinese README with the same guidance.
  • Add an explicit warning not to call monitor.New or monitor.NewMonitor inside adaptor.HTTPMiddleware.
  • Clarify that the safe Fiber example only serves /monitor and does not wrap all Fiber business routes.
  • Add v1.0.1 release notes.

Notes

Correct net/http usage remains safe when monitor.New is called once during startup. Full Fiber business request accounting should be implemented with a native Fiber adapter instead of wrapping monitor.New through adaptor.HTTPMiddleware.

Testing

Documentation-only change. No runtime tests were run.

@gofurry gofurry self-assigned this Jun 25, 2026
@gofurry gofurry added bug Something isn't working documentation Improvements or additions to documentation labels Jun 25, 2026
@gofurry gofurry merged commit 0369211 into main Jun 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant