Skip to content

internal/debug: add support for grafana pyroscope sdk#33261

Closed
cbermudez97 wants to merge 7 commits into
ethereum:performancefrom
cbermudez97:performance
Closed

internal/debug: add support for grafana pyroscope sdk#33261
cbermudez97 wants to merge 7 commits into
ethereum:performancefrom
cbermudez97:performance

Conversation

@cbermudez97

Copy link
Copy Markdown
Contributor

Summary
Add support for Grafana Pyroscope SDK in the Geth client.

Changes

  • Added flags to enable and configure the Pyroscope SDK Push mode.
  • Updated debug handler so it can start and stop the Pyroscope service.

Usage

geth --pyroscope --pyroscope.server=http://localhost:4040 --pyroscope.tags=instance=my-instance

MariusVanDerWijden and others added 6 commits September 20, 2025 11:07
- Added Pyroscope profiling capabilities to the debug package.
- Introduced command-line flags for enabling profiling and specifying the Pyroscope server URL.
- Implemented methods to start and stop the Pyroscope profiler, including a custom logger to interface with the existing logging system.
- Updated relevant files to accommodate the new profiling features.
- Updated StartPyroscopeProfiler to accept a map of tags for profiling data.
- Introduced a new command-line flag for specifying comma-separated key=value tags.
- Modified Setup function to parse and pass tags to the profiler, improving profiling data granularity.
@fjl fjl self-assigned this Nov 26, 2025
@fjl

fjl commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

I really like the idea, and the integration is done well in package internal/debug. We will deploy Pyroscope internally to try this.

@fjl fjl changed the title feat: add support for grafana pyroscope sdk internal/debug: add support for grafana pyroscope sdk Nov 26, 2025
@cbermudez97

Copy link
Copy Markdown
Contributor Author

Tested these changes with this setup: https://gist.github.com/cbermudez97/c3c219799613a3d8edfba2667ec740f3

Checking the implementation again I didn't add any Auth config options for connection to the Pyroscope server. With the Grafana Alloy usage as a middleman it could handle all available options for auth without complicating too much the Geth config. Still, I could add some of the options if needed (Maybe basic auth?).

@fjl

fjl commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Yes we need the auth. In our setups, we will typically report metrics across the Internet, talking to a public https endpoint with authentication.

@fjl

fjl commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

It should be handled similar to how influxdb metrics are configured.

@fjl fjl added this to the 1.17.0 milestone Jan 15, 2026
@fjl

fjl commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

I just realized this PR is against the performance branch. It needs to be opened against the master branch to be mergeable.

@fjl

fjl commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

I have resubmitted against master in #33623 with some changes.

@fjl fjl closed this Jan 16, 2026
fjl added a commit that referenced this pull request Jan 20, 2026
This adds support for Grafana Pyroscope, a continuous profiling solution. 
The client is configured similarly to metrics, i.e. run 

     geth --pyroscope --pyroscope.server=https://...

This commit is a resubmit of #33261 with some changes.

---------

Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>
gballet pushed a commit to BZO95/go-ethereum that referenced this pull request May 21, 2026
This adds support for Grafana Pyroscope, a continuous profiling solution. 
The client is configured similarly to metrics, i.e. run 

     geth --pyroscope --pyroscope.server=https://...

This commit is a resubmit of ethereum#33261 with some changes.

---------

Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>
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.

6 participants