-
Notifications
You must be signed in to change notification settings - Fork 31
feat: add profiling middleware fastify #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add profiling middleware fastify #173
Conversation
monwolf
commented
Nov 6, 2025
- Implemented Fastify middleware for heap and wall profiling.
- Renamed tests for Express middleware
- Added tests for Fastify middleware to verify CPU and heap profiling responses.
- Implemented Express middleware for heap and wall profiling. - Implemented Fastify middleware for heap and wall profiling. - Added tests for Express middleware to verify CPU and heap profiling responses. - Added tests for Fastify middleware to verify CPU and heap profiling responses. - Both middlewares support simultaneous requests and can be used concurrently in different applications.
|
This PR closes #124 (comment) |
|
@jake-kramer could you review it? |
|
@monwolf Thanks for your contribution! I can take a look at this next week |
|
I'd like |
There was a problem hiding this 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 Fastify middleware support to the Pyroscope Node.js profiler alongside the existing Express middleware. The implementation follows a similar pattern to Express but is adapted for Fastify's plugin system.
Key Changes:
- Added Fastify middleware implementation for heap and wall profiling endpoints
- Refactored middleware loading to use dynamic imports with optional peer dependencies
- Added comprehensive test coverage for Fastify middleware
- Renamed/moved Express middleware files and tests for better organization
Reviewed Changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/middleware/fastify.ts | New Fastify plugin implementation providing /debug/pprof/heap and /debug/pprof/profile routes |
| src/middleware/express.ts | Express middleware relocated to middleware directory |
| src/index.ts | Refactored to dynamically load middleware implementations with error handling for missing peer dependencies |
| test/fastify.test.ts | New comprehensive test suite for Fastify middleware functionality |
| test/express.test.ts | Express tests relocated to match new structure |
| package.json | Added Fastify as optional peer dependency with proper metadata |
| yarn.lock | Updated dependencies including Fastify and related packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bryanhuhta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great new add. LGTM!