Documentation
¶
Overview ¶
Package profiling interacts with internal profiling
Index ¶
Constants ¶
View Source
const ( // ProfilingURLTemplate constant template for expected profiling endpoint URL. ProfilingURLTemplate = "https://intake.profile.%s/v1/input" // ProfilingLocalURLTemplate is the constant used to compute the URL of the local trace agent ProfilingLocalURLTemplate = "http://%v/profiling/v1/input" )
Variables ¶
This section is empty.
Functions ¶
func GetBaseProfilingTags ¶
GetBaseProfilingTags returns the standard tags that should be included in all internal profiling
func GetBlockProfileRate ¶ added in v0.9.0
func GetBlockProfileRate() int
GetBlockProfileRate returns the current rate of goroutine blocking profile.
func GetMutexProfileFraction ¶ added in v0.9.0
func GetMutexProfileFraction() int
GetMutexProfileFraction returns the current fraction of mutexes that generate profile data.
func IsRunning ¶ added in v0.9.0
func IsRunning() bool
IsRunning returns true if the profiler is running; this function is thread-safe.
func SetBlockProfileRate ¶ added in v0.9.0
func SetBlockProfileRate(rate int)
SetBlockProfileRate sets goroutine blocking profile rate.
func SetMutexProfileFraction ¶ added in v0.9.0
func SetMutexProfileFraction(fraction int)
SetMutexProfileFraction sets fraction of mutexes that generate profiling data.
Types ¶
type Settings ¶ added in v0.9.0
type Settings struct {
// Socket specifies a unix socket to which profiles will be sent.
Socket string
// ProfilingURL specifies the URL to which profiles will be sent in
// agentless mode. This can be constructed from a site value with
// ProfilingURLTemplate.
ProfilingURL string
// Env specifies the environment to which profiles should be registered.
Env string
// Service specifies the service name to attach to a profile.
Service string
// Period specifies the interval at which to collect profiles.
Period time.Duration
// CPUDuration specifies the length at which to collect CPU profiles.
CPUDuration time.Duration
// MutexProfileFraction, if set, turns on mutex profiles with rate
// indicating the fraction of mutex contention events reported in the mutex
// profile.
MutexProfileFraction int
// BlockProfileRate turns on block profiles with the given rate.
BlockProfileRate int
// WithGoroutineProfile additionally reports stack traces of all current goroutines
WithGoroutineProfile bool
// WithBlockProfile additionally enables block profiling
WithBlockProfile bool
// WithMutexProfile additionally enables mutex profiling
WithMutexProfile bool
// WithDeltaProfiles specifies if delta profiles are enabled
WithDeltaProfiles bool
// Tags are the additional tags to attach to profiles.
Tags []string
// CustomAttributes names of goroutine labels to use as custom attributes in Datadog Profiling UI
CustomAttributes []string
}
Settings contains the settings for internal profiling, to be passed to Start().
Click to show internal directories.
Click to hide internal directories.