Skip to content

chore: enable collection of cpu data - #4267

Merged
vinayteki95 merged 3 commits into
developfrom
chore.enable-pyroscope-cpu-profiles
May 5, 2025
Merged

vinayteki95 merged 3 commits into
developfrom
chore.enable-pyroscope-cpu-profiles

Conversation

@vinayteki95

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Enable profile_cpu-cpu for pyroscope along with profile_cpu-wall data for cpu specific profile information.

What is the related Linear task?

Resolves INT-3493

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

N/A

@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.

@vinayteki95
vinayteki95 requested a review from a team April 21, 2025 11:13
@coderabbitai

coderabbitai Bot commented Apr 21, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Enabled CPU time collection for profiling in the application.
  • Tests

    • Updated tests to verify that CPU time collection is enabled during profiling initialization.

Summary by CodeRabbit

  • Chores
    • Enabled CPU time collection for profiling to improve performance monitoring.

Walkthrough

The change updates the Pyroscope profiler configuration within src/middleware.js by enabling the collectCpuTime option under the wall key. This adjustment ensures that CPU time is now collected during profiling. Correspondingly, the test in src/middleware.test.js was updated to verify this new configuration. No other middleware logic or exported entities were modified.

Changes

File(s) Change Summary
src/middleware.js Updated Pyroscope initialization to add wall: { collectCpuTime: true } to the configuration.
src/middleware.test.js Updated test to expect Pyroscope initialization with the new wall: { collectCpuTime: true } config.

Possibly related PRs

Suggested reviewers

  • sivashanmukh
  • yashasvibajpai

Suggestion:
Consider documenting this configuration change in your internal profiling or operations documentation to ensure future maintainers are aware of the new CPU time collection behavior. This can help with troubleshooting and performance analysis down the line. Additionally, monitoring the impact of this change on profiling data and system performance might be beneficial to validate its effectiveness.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cedac7e and 77e26e0.

📒 Files selected for processing (1)
  • src/middleware.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: Focus on ESLint errors (max 3) and warnings (max 5).

**/*.js: Focus on ESLint errors (max 3) and warnings (max 5).

  • src/middleware.test.js
🧬 Code Graph Analysis (1)
src/middleware.test.js (1)
src/middleware.js (1)
  • Pyroscope (1-1)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • 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: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
src/middleware.test.js (1)

31-36: LGTM: Pyroscope configuration updated to collect CPU time

The changes correctly update the test to verify that Pyroscope is initialized with CPU time collection enabled. The added configuration wall: { collectCpuTime: true } directly corresponds to the PR objective of enabling CPU profiling data.

As a minor suggestion, consider updating the test description on line 30 to better reflect what's being tested:

- it('should initialize Pyroscope with the correct app name', () => {
+ it('should initialize Pyroscope with the correct app name and CPU time collection', () => {

This would make the test description more accurately reflect the complete verification being performed.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov

codecov Bot commented Apr 21, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.21%. Comparing base (f990bf6) to head (77e26e0).
Report is 33 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4267      +/-   ##
===========================================
+ Coverage    91.17%   91.21%   +0.04%     
===========================================
  Files          632      632              
  Lines        33079    33057      -22     
  Branches      7831     7832       +1     
===========================================
- Hits         30160    30154       -6     
- Misses        2674     2688      +14     
+ Partials       245      215      -30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/middleware.js (1)

8-10: Make CPU collection configurable Consider guarding this flag behind an environment variable (e.g., process.env.PYROSCOPE_CPU_PROFILE_ENABLED) or a config option so teams can opt in or out of CPU profiling to minimize runtime overhead when it’s not needed.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbfa641 and cedac7e.

📒 Files selected for processing (1)
  • src/middleware.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: Focus on ESLint errors (max 3) and warnings (max 5).

**/*.js: Focus on ESLint errors (max 3) and warnings (max 5).

  • src/middleware.js
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
src/middleware.js (2)

8-10: Well-structured addition The new wall.collectCpuTime: true flag correctly aligns with the PR’s goal of capturing CPU profiling data alongside wall time. The syntax is clean and integrates seamlessly into the existing config.


8-10: Validate Pyroscope configuration Please verify against the official Pyroscope Node.js documentation that setting collectCpuTime under wall is sufficient to enable CPU profiling. There may be a separate cpu section or additional profiles keys required to capture CPU metrics.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

Copy link
Copy Markdown

@vinayteki95
vinayteki95 merged commit d4a616b into develop May 5, 2025
@vinayteki95
vinayteki95 deleted the chore.enable-pyroscope-cpu-profiles branch May 5, 2025 07:21
@coderabbitai coderabbitai Bot mentioned this pull request Jul 22, 2025
8 of 10 tasks
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.

4 participants