Skip to content

feat: add CPU profiling pull mode - #366

Open
arnabnandy7 wants to merge 5 commits into
grafana:mainfrom
arnabnandy7:feature/pullmode
Open

arnabnandy7 wants to merge 5 commits into
grafana:mainfrom
arnabnandy7:feature/pullmode

Conversation

@arnabnandy7

@arnabnandy7 arnabnandy7 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in pull mode that lets collectors request CPU profiles over HTTP in pprof format.

The implementation builds on the existing configuration and profiler interfaces, with bounded recording durations, concurrent-request protection and lifecycle cleanup. Existing push behavior remains the default.

This initial version supports async-profiler CPU profiling on Linux and macOS. Dynamic labels and trace context are not included.

Includes setup documentation, an Alloy example and focused tests. Compilation and packaging passed; tests and end-to-end collector verification remain pending.

Closes #13

Test Summary:

image image

@arnabnandy7
arnabnandy7 requested review from a team as code owners September 12, 2026 09:23

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread README.md Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0f625b1. Configure here.

Comment thread agent/build.gradle Outdated
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@grcevski

Copy link
Copy Markdown

I think there's a lot of code here that needs to be better tested. For example the pprof encoding. I think we need some sort of proof that those encoders work properly for pprof.

Also, is it possible for you to split the pull request commits by concern and commit piece by piece with the tests.

@arnabnandy7

arnabnandy7 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

I think there's a lot of code here that needs to be better tested. For example the pprof encoding. I think we need some sort of proof that those encoders work properly for pprof.

Also, is it possible for you to split the pull request commits by concern and commit piece by piece with the tests.

It'll take sometime but I'll split it here @grcevski thanks for your reviews.

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@arnabnandy7

Copy link
Copy Markdown
Contributor Author

@grcevski it's done, please review

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.

Implement pull mode

2 participants