This guide will help you get started developing Pyroscope.
Pyroscope consists of 2 core components:
- webapp, mostly JS code, UI for the web application
- go code, this is all the backend code including profiling code and the storage engine.
Make sure you have the following dependencies installed before setting up your developer environment:
rust(you'll only need it to work on Python and Ruby integrations)
On macOS we recommend you to use homebrew to manage dependencies:
Building pyroscope locally
To start developing Pyroscope you need to know a few commands:
If you're using VS Code we would recommend the official Go extension from Google.
revive for linting. Add
Go: Lint Flags section in VS Code settings.
To make sure VS Code adds new lines, set
true. See this stack overflow answer for context on why this is important.
Please checkout out the style guides we use.
We use logrus library for logging purposes. There are two rules we follow when it comes to logging:
pkg/agent/profilershould not depend on
logrus. This is because we don't want our users' logs to be tainted with pyroscope messages.
- Be mindful of log levels. Only log information that would truly be useful to an average end user in log levels
Infoor higher. When in doubt, lean on the side of moving log messages to
Used as a collection of shortcuts, e.g
make build or
docker-compose examples for integrations with different languages.
Main place for the go code. We use golang-standards/project-layout as the standard for where different parts of the system should go. See Style Guide for more information on various style guides we use.
Code that does the actual profiling.
pyroscope exec. Mostly code related to command line interface.
Server related code, mostly HTTP controllers.
Storage code. Heavy on various tree-like data structures, low level database things.
Place for command line interface initialization code.
Place where we define the developer dependencies for go code. Kind of like
devDependencies, but for Go.
This is where the webapp lives.
Location for various helper programs / scripts.
Helper code / files we use to make releases and generate packages for Linux / macOS. See Downloads page for more information.
Pyroscope depends on a few rust projects, particularly