Skip to content

omerglam/go-probe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

goprobe

goprobe_half

Continuous profiling

This package provide ability to enable on demand continuous profiling on a Go process

Usage

Similar to pprof in order to use the profiler one should export the profiler package for side effects:

_ "github.com/omerglam/goprobe"

The package will register a new endpoint(/profiler/toggle) on the default server mux that allows to toggle on\off the profiler.

Endpoint usage example

To toggle the profiler ON: execute an HTTP POST request to the profiler/toggle endpoint with the next request body:

curl -X POST -d  '{"applicationName":"my-app", "collectorAddress": "http://pyroscope.o11y:4040", "tags":{"namespace": "app-namespace"}}'  127.0.0.1:6061/profiler/toggle

where: - collectorAddress - represent the pyroscope server address - applicationName - name that will be used in the pyroscope - tags - key value pairs for additional metadata on pyroscope

To toggle the profiler OFF:

curl -X POST 127.0.0.1:6061/profiler/toggle

Limitations

The package will create a http server listing on localhost:6061 and will accept only request coming from local address




About

live profiling toggling of Go applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages