collector

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configPath string, fn func(CollectorConfig)) error

LoadConfig watch configPath change, callback fn

Types

type Collector

type Collector struct {
	TargetName string
	TargetConfig
	// contains filtered or unexported fields
}

Collector Collect target pprof http endpoints

type CollectorConfig

type CollectorConfig struct {
	//key TargetName
	TargetConfigs map[string]TargetConfig `yaml:"targetConfigs"`
}

type Config

type Config struct {
	Collector CollectorConfig `yaml:"collector"`
}

type LabelConfig

type LabelConfig map[string]string

func (LabelConfig) ToArray

func (t LabelConfig) ToArray() []storage.Label

type Manger

type Manger struct {
	// contains filtered or unexported fields
}

Manger Manage multiple collectors to scraping

func NewManger

func NewManger(store storage.Store) *Manger

NewManger new Manger instance

func (*Manger) Load

func (manger *Manger) Load(config CollectorConfig)

Load collector configuration It can be called multiple times, and the collector updates the configuration

func (*Manger) Stop

func (manger *Manger) Stop()

Stop Manger instance

type ProfileConfig

type ProfileConfig struct {
	Path   string `yaml:"path"`
	Enable *bool  `yaml:"enable"`
}

type TargetConfig

type TargetConfig struct {
	//key is profile name (profile, fgprof, mutex, heap, goroutine, allocs, block, threadcreate)
	ProfileConfigs map[string]ProfileConfig `yaml:"profileConfigs"`
	Interval       time.Duration            `yaml:"interval"`
	Expiration     time.Duration            `yaml:"expiration"`
	Instances      []string                 `yaml:"instances"`
	Labels         LabelConfig              `yaml:"labels"`
}

Jump to

Keyboard shortcuts

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