config

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BucketValid = BucketRule{}
View Source
var ObjectStorageValid = ObjectStorageValidRule{}

ObjectStorageValid is the ValidRule.

View Source
var ScrapeConfigsValid = ScrapeConfigsValidRule{}

ScrapeConfigsValid is the ValidRule.

Functions

func CheckTargetAddress

func CheckTargetAddress(address model.LabelValue) error

CheckTargetAddress checks if target address is valid.

Types

type BucketRule added in v0.13.0

type BucketRule struct{}

func (BucketRule) Validate added in v0.13.0

func (r BucketRule) Validate(value interface{}) error

Validate the bucket config.

type ComponentReloader added in v0.12.0

type ComponentReloader struct {
	Name     string
	Reloader func(*Config) error
}

ComponentReloader describes how to reload a component.

type Config

type Config struct {
	ObjectStorage *ObjectStorage  `yaml:"object_storage,omitempty"`
	ScrapeConfigs []*ScrapeConfig `yaml:"scrape_configs,omitempty"`
}

Config holds all the configuration information for Parca.

func Load

func Load(s string) (*Config, error)

Load parses the YAML input s into a Config.

func LoadFile

func LoadFile(filename string) (*Config, error)

LoadFile parses the given YAML file into a Config.

func (*Config) SetDirectory

func (c *Config) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (Config) String

func (c Config) String() string

func (*Config) Validate added in v0.2.0

func (c *Config) Validate() error

Validate returns an error if the config is not valid.

type ConfigReloader added in v0.12.0

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

ConfigReloader holds all information required to reload Parca's config into its running components.

func NewConfigReloader added in v0.12.0

func NewConfigReloader(
	logger log.Logger,
	reg prometheus.Registerer,
	filename string,
	reloaders []ComponentReloader,
) (*ConfigReloader, error)

NewConfigReloader returns an instantiated config reloader.

func (*ConfigReloader) Run added in v0.12.0

func (r *ConfigReloader) Run(ctx context.Context) error

Run starts watching the config file and wait for reload triggers.

type ObjectStorage added in v0.13.0

type ObjectStorage struct {
	Bucket *client.BucketConfig `yaml:"bucket,omitempty"`
}

type ObjectStorageValidRule added in v0.15.0

type ObjectStorageValidRule struct{}

ObjectStorageValidRule is a validation rule for the Config. It implements the validation.Rule interface.

func (ObjectStorageValidRule) Validate added in v0.15.0

func (v ObjectStorageValidRule) Validate(value interface{}) error

ObjectStorageValidate returns an error if the config is not valid.

type PprofConfig

type PprofConfig map[string]*PprofProfilingConfig

type PprofProfilingConfig

type PprofProfilingConfig struct {
	Enabled        *bool        `yaml:"enabled,omitempty"`
	Path           string       `yaml:"path,omitempty"`
	Delta          bool         `yaml:"delta,omitempty"`
	KeepSampleType []SampleType `yaml:"keep_sample_type,omitempty"`
}

type ProfilingConfig

type ProfilingConfig struct {
	PprofConfig PprofConfig `yaml:"pprof_config,omitempty"`
	PprofPrefix string      `yaml:"path_prefix,omitempty"`
}

type SampleType added in v0.19.0

type SampleType struct {
	Type string `yaml:"type,omitempty"`
	Unit string `yaml:"unit,omitempty"`
}

type ScrapeConfig

type ScrapeConfig struct {
	// Name of the section in the config
	JobName string `yaml:"job_name"`
	// A set of query parameters with which the target is scraped.
	Params url.Values `yaml:"params,omitempty"`
	// How frequently to scrape the targets of this scrape config.
	ScrapeInterval model.Duration `yaml:"scrape_interval,omitempty"`
	// The timeout for scraping targets of this config.
	ScrapeTimeout model.Duration `yaml:"scrape_timeout,omitempty"`
	// The URL scheme with which to fetch metrics from targets.
	Scheme string `yaml:"scheme,omitempty"`

	// NormalizedAddresses can be set to true if the addresses returned by the
	// endpoints have already been normalized.
	NormalizedAddresses bool `yaml:"normalized_addresses,omitempty"`

	ProfilingConfig *ProfilingConfig `yaml:"profiling_config,omitempty"`

	RelabelConfigs []*relabel.Config `yaml:"relabel_configs,omitempty"`
	// We cannot do proper Go type embedding below as the parser will then parse
	// values arbitrarily into the overflow maps of further-down types.
	ServiceDiscoveryConfigs discovery.Configs             `yaml:"-"`
	HTTPClientConfig        commonconfig.HTTPClientConfig `yaml:",inline"`
}

ScrapeConfig configures a scraping unit for conprof.

func DefaultScrapeConfig

func DefaultScrapeConfig() ScrapeConfig

func (*ScrapeConfig) SetDirectory

func (c *ScrapeConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*ScrapeConfig) UnmarshalYAML

func (c *ScrapeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type ScrapeConfigsValidRule added in v0.21.0

type ScrapeConfigsValidRule struct{}

ScrapeConfigsValidRule is a validation rule for the Config. It implements the validation.Rule interface.

func (ScrapeConfigsValidRule) Validate added in v0.21.0

func (v ScrapeConfigsValidRule) Validate(value interface{}) error

ScrapeConfigsValidate returns an error if the config is not valid.

type Secret

type Secret string

Secret special type for storing secrets.

func (Secret) MarshalYAML

func (s Secret) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface for Secrets.

func (*Secret) UnmarshalYAML

func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for Secrets.

type ServiceDiscoveryConfig

type ServiceDiscoveryConfig struct {
	// List of labeled target groups for this job.
	StaticConfigs []*targetgroup.Group `yaml:"static_configs,omitempty"`
}

ServiceDiscoveryConfig configures lists of different service discovery mechanisms.

Jump to

Keyboard shortcuts

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