config

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{

	Prometheus:   prom.DefaultConfig,
	Integrations: integrations.DefaultManagerConfig,
}

DefaultConfig holds default settings for all the subsystems.

Functions

func LoadBytes added in v0.4.0

func LoadBytes(buf []byte, expandEnvVars bool, c *Config) error

LoadBytes unmarshals a config from a buffer. Defaults are not applied to the file and must be done manually if LoadBytes is called directly.

func LoadFile

func LoadFile(filename string, expandEnvVars bool, c *Config) error

LoadFile reads a file and passes the contents to Load

Types

type Config

type Config struct {
	Server       server.Config              `yaml:"server,omitempty"`
	Prometheus   prom.Config                `yaml:"prometheus,omitempty"`
	Loki         loki.Config                `yaml:"loki,omitempty"`
	Integrations integrations.ManagerConfig `yaml:"integrations,omitempty"`
	Tempo        tempo.Config               `yaml:"tempo,omitempty"`

	// We support a secondary server just for the /-/reload endpoint, since
	// invoking /-/reload against the primary server can cause the server
	// to restart.
	ReloadAddress string `yaml:"-"`
	ReloadPort    int    `yaml:"-"`
}

Config contains underlying configurations for the agent

func Load

func Load(fs *flag.FlagSet, args []string) (*Config, error)

Load loads a config file from a flagset. Flags will be registered to the flagset before parsing them with the values specified by args.

func (*Config) ApplyDefaults

func (c *Config) ApplyDefaults() error

ApplyDefaults sets default values in the config

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers flags in underlying configs

func (*Config) UnmarshalYAML added in v0.14.0

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

UnmarshalYAML implements yaml.Unmarshaler.

Jump to

Keyboard shortcuts

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