Documentation ¶
Index ¶
- Constants
- Variables
- func LabelsByProfiles(lset labels.Labels, c *ProfilingConfig) []labels.Labels
- type Arguments
- type Component
- type CustomProfilingTarget
- type Manager
- func (m *Manager) ApplyConfig(cfg Arguments) error
- func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group)
- func (m *Manager) Stop()
- func (m *Manager) TargetsActive() map[string][]*Target
- func (m *Manager) TargetsAll() map[string][]*Target
- func (m *Manager) TargetsDropped() map[string][]*Target
- type ProfilingConfig
- type ProfilingTarget
- type Target
- func (t *Target) Clone() *Target
- func (t *Target) DiscoveredLabels() labels.Labels
- func (t *Target) Health() TargetHealth
- func (t *Target) Labels() labels.Labels
- func (t *Target) LastError() error
- func (t *Target) LastScrape() time.Time
- func (t *Target) LastScrapeDuration() time.Duration
- func (t *Target) Params() url.Values
- func (t *Target) SetDiscoveredLabels(l labels.Labels)
- func (t *Target) String() string
- func (t *Target) URL() *url.URL
- type TargetHealth
- type Targets
Constants ¶
const ( ProfilePath = "__profile_path__" ProfileName = "__name__" ProfileTraceType = "trace" )
Variables ¶
var DefaultArguments = NewDefaultArguments()
var DefaultProfilingConfig = ProfilingConfig{ Memory: ProfilingTarget{ Enabled: true, Path: "/debug/pprof/allocs", }, Block: ProfilingTarget{ Enabled: true, Path: "/debug/pprof/block", }, Goroutine: ProfilingTarget{ Enabled: true, Path: "/debug/pprof/goroutine", }, Mutex: ProfilingTarget{ Enabled: true, Path: "/debug/pprof/mutex", }, ProcessCPU: ProfilingTarget{ Enabled: true, Path: "/debug/pprof/profile", Delta: true, }, FGProf: ProfilingTarget{ Enabled: false, Path: "/debug/fgprof", Delta: true, }, }
Functions ¶
func LabelsByProfiles ¶
func LabelsByProfiles(lset labels.Labels, c *ProfilingConfig) []labels.Labels
LabelsByProfiles returns the labels for a given ProfilingConfig.
Types ¶
type Arguments ¶
type Arguments struct { Targets []discovery.Target `river:"targets,attr"` ForwardTo []phlare.Appendable `river:"forward_to,attr"` // The job name to override the job label with. JobName string `river:"job_name,attr,optional"` // A set of query parameters with which the target is scraped. Params url.Values `river:"params,attr,optional"` // How frequently to scrape the targets of this scrape config. ScrapeInterval time.Duration `river:"scrape_interval,attr,optional"` // The timeout for scraping targets of this config. ScrapeTimeout time.Duration `river:"scrape_timeout,attr,optional"` // The URL scheme with which to fetch metrics from targets. Scheme string `river:"scheme,attr,optional"` HTTPClientConfig component_config.HTTPClientConfig `river:",squash"` ProfilingConfig ProfilingConfig `river:"profiling_config,block,optional"` }
Arguments holds values which are used to configure the pprof.scrape component.
func NewDefaultArguments ¶
func NewDefaultArguments() Arguments
NewDefaultArguments create the default settings for a scrape job.
func (*Arguments) UnmarshalRiver ¶
UnmarshalRiver implements river.Unmarshaler.
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component implements the pprof.scrape component.
func (*Component) DebugInfo ¶
func (c *Component) DebugInfo() interface{}
DebugInfo implements component.DebugComponent
type CustomProfilingTarget ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(appendable phlare.Appendable, logger log.Logger) *Manager
func (*Manager) ApplyConfig ¶
ApplyConfig resets the manager's target providers and job configurations as defined by the new cfg.
func (*Manager) Run ¶
func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group)
Run receives and saves target set updates and triggers the scraping loops reloading. Reloading happens in the background so that it doesn't block receiving targets updates.
func (*Manager) TargetsActive ¶
TargetsActive returns the active targets currently being scraped.
func (*Manager) TargetsAll ¶
TargetsAll returns active and dropped targets grouped by job_name.
func (*Manager) TargetsDropped ¶
TargetsDropped returns the dropped targets during relabelling.
type ProfilingConfig ¶
type ProfilingConfig struct { Memory ProfilingTarget `river:"profile.memory,block,optional"` Block ProfilingTarget `river:"profile.block,block,optional"` Goroutine ProfilingTarget `river:"profile.goroutine,block,optional"` Mutex ProfilingTarget `river:"profile.mutex,block,optional"` ProcessCPU ProfilingTarget `river:"profile.process_cpu,block,optional"` FGProf ProfilingTarget `river:"profile.fgprof,block,optional"` Custom []CustomProfilingTarget `river:"profile.custom,block,optional"` PprofPrefix string `river:"path_prefix,attr,optional"` }
func (ProfilingConfig) AllTargets ¶
func (cfg ProfilingConfig) AllTargets() map[string]ProfilingTarget
AllTargets returns the set of all standard and custom profiling targets, regardless of whether they're enabled. The key in the map indicates the name of the target.
func (*ProfilingConfig) UnmarshalRiver ¶
func (cfg *ProfilingConfig) UnmarshalRiver(f func(interface{}) error) error
UnmarshalRiver implements river.Unmarshaler and applies defaults before unmarshaling.
type ProfilingTarget ¶
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target refers to a singular HTTP or HTTPS endpoint.
func (*Target) DiscoveredLabels ¶
DiscoveredLabels returns a copy of the target's labels before any processing.
func (*Target) Health ¶
func (t *Target) Health() TargetHealth
Health returns the last known health state of the target.
func (*Target) LastScrape ¶
LastScrape returns the time of the last scrape.
func (*Target) LastScrapeDuration ¶
LastScrapeDuration returns how long the last scrape of the target took.
func (*Target) SetDiscoveredLabels ¶
SetDiscoveredLabels sets new DiscoveredLabels.
type TargetHealth ¶
type TargetHealth string
TargetHealth describes the health state of a target.
const ( HealthUnknown TargetHealth = "unknown" HealthGood TargetHealth = "up" HealthBad TargetHealth = "down" )
The possible health states of a target based on the last performed scrape.