Skip to content

Conversation

@cbermudez97
Copy link

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

- 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
Copy link
Contributor

fjl commented Nov 26, 2025

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
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
Copy link
Contributor

fjl commented Nov 26, 2025

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
Copy link
Contributor

fjl commented Nov 26, 2025

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

@fjl fjl removed the status:triage label Dec 2, 2025
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.

3 participants