Go

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Pyroscope uses the standard runtime/pprof package to collect profiling data. Refer to the official documentation for details.

Supported platforms

Spy NameTypeLinuxmacOSWindowsDocker
n/astandalone

Profiling Go application

To start profiling a Go application, you need to include our go module in your app. Here's a code snippet:

package main
import "github.com/pyroscope-io/pyroscope/pkg/agent/profiler"
func main() {
profiler.Start(profiler.Config{
ApplicationName: "simple.golang.app",
// replace this with the address of pyroscope server
ServerAddress: "http://pyroscope-server:4040",
// by default all profilers are enabled,
// but you can select the ones you want to use:
ProfileTypes: []profiler.ProfileType{
profiler.ProfileCPU,
profiler.ProfileAllocObjects,
profiler.ProfileAllocSpace,
profiler.ProfileInuseObjects,
profiler.ProfileInuseSpace,
},
})
// your code goes here
}

Check out the examples folder in our repository to learn more 🔥