profile

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

Profile

Profile package is used to perform memory and CPU profiling using Pyroscope. Once enabled, the application pushes periodic metric to a pyroscope server.

Usage

Set the following mandatory env variables to enable profiling:

# Mandatory
PYROSCOPE_HOST="host:port"
APP_NAME="app_name"

# Optional
RELEASE_VERSION="v1.2.3"

Add the above mandatory env variables and call InitPyroscope() in main.go to enable profiling with default profileTypes.

Use InitPyroscopeWithProfiles() to enable profiling with specific profileTypes.

Features

// these profile types are enabled by default:
pyroscope.ProfileCPU,
pyroscope.ProfileAllocObjects,
pyroscope.ProfileAllocSpace,
pyroscope.ProfileInuseObjects,
pyroscope.ProfileInuseSpace,

// these profile types are optional and can used with InitPyroscopeWithProfiles():
pyroscope.ProfileGoroutines,
pyroscope.ProfileMutexCount,
pyroscope.ProfileMutexDuration,
pyroscope.ProfileBlockCount,
pyroscope.ProfileBlockDuration,

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitPyroscope

func InitPyroscope() error

InitPyroscope initialises profiling using Pyroscope.

func InitPyroscopeWithProfiles

func InitPyroscopeWithProfiles(profileTypes []pyroscope.ProfileType) error

InitPyroscopeWithProfiles initialises profiling wit specified ProfileTypes. List of profiles can be found here: https://github.com/grafana/pyroscope-golang/blob/main/pyroscope/types.go

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL