Repository navigation
fix: pyroscope memory and wall prof - #4519
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughThe changes introduce environment-driven constants for Pyroscope profiling parameters, update the Pyroscope initialization to explicitly include wall and heap profiling configurations, and ensure profiling activation with Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant MW as Middleware
participant Pyro as Pyroscope
App->>MW: Import and configure middleware
MW->>Pyro: Pyroscope.init({ wallConfig, heapConfig, ... })
MW->>Pyro: Pyroscope.start()
App->>MW: Use exported profiling constants
Estimated code review effort2 (~15 minutes) Possibly related PRs
Suggested reviewers
Suggestions for improvement:
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/middleware.js(2 hunks)src/middleware.test.js(3 hunks)
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit Configuration File
Focus on ESLint errors (max 3) and warnings (max 5).
Files:
src/middleware.test.jssrc/middleware.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit Configuration File
Focus on ESLint errors (max 3) and warnings (max 5).
Files:
src/middleware.test.jssrc/middleware.js
⏰ 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). (8)
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Code Coverage
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (4)
src/middleware.js (2)
22-37: Excellent Pyroscope configuration implementation.The configuration properly enables comprehensive profiling with well-documented parameters. The omission of
serverAddressfor pull mode and the explicitPyroscope.start()call correctly implement the requirements for Grafana Agent scraping.
93-96: Good addition of constant exports.The new constants are properly exported, enabling external access for testing and configuration verification.
src/middleware.test.js (2)
8-11: Proper test setup for new constants and mock.The imports correctly include all new profiling constants, and the Pyroscope mock properly includes the
startmethod to match the actual implementation.Also applies to: 22-22
38-50: Comprehensive test coverage for updated Pyroscope configuration.The test properly verifies that
Pyroscope.initis called with the complete configuration object, including all new wall and heap profiling parameters. Using the imported constants ensures accurate validation of the actual configuration values.
|
Allure Test reports for this run are available at:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release/v1.105.0 #4519 +/- ##
===================================================
Coverage ? 91.44%
===================================================
Files ? 639
Lines ? 33786
Branches ? 7982
===================================================
Hits ? 30897
Misses ? 2655
Partials ? 234 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Allure Test reports for this run are available at:
|
|



What are the changes introduced in this PR?
Improved Pyroscope instrumentation to capture wall, cpu and memory profiling data with default configurations. Profiling configurations can be controlled via new ENV variables.
PYROSCOPE_WALL_SAMPLING_DURATION_MSPYROSCOPE_WALL_SAMPLING_INTERVAL_MICROSPYROSCOPE_HEAP_SAMPLING_INTERVAL_BYTESPYROSCOPE_HEAP_STACK_DEPTHWhat is the related Linear task?
Resolves INT-3895
Please explain the objectives of your changes below
Pyroscope memory utilisation has been missing for a long time. This has been a need for observability team as well as integrations team to debug memory intensive components in transformer. Especially to debug memory based crashes and errors in transformer.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Memory profiling for transformer via new configurations
Any new dependencies introduced with this change?
No
Any new generic utility introduced or modified. Please explain the changes.
New ENVs introduced.
Any technical or performance related pointers to consider with the change?
Memory profiling might put some extra load on the transformer. This has to be seen live to understand the effects of it.
@coderabbitai review
Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.