Documentation ¶
Overview ¶
Package logs holds types for the logging subsystem of Grafana Agent static mode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultGlobalConfig = GlobalConfig{ ClientConfigs: []client.Config{}, FileWatch: file.WatchConfig{ MinPollFrequency: 250 * time.Millisecond, MaxPollFrequency: 250 * time.Millisecond, }, }
DefaultGlobalConfig holds default global settings to be used across all instances.
Functions ¶
func DefaultConfig ¶
DefaultConfig returns a default config for a Logs instance.
Types ¶
type Config ¶
type Config struct { PositionsDirectory string `yaml:"positions_directory,omitempty"` Global GlobalConfig `yaml:"global,omitempty"` Configs []*InstanceConfig `yaml:"configs,omitempty"` }
Config controls the configuration of the Loki log scraper.
func (*Config) ApplyDefaults ¶
ApplyDefaults applies defaults to the Config and ensures that it is valid.
Validations:
- No two InstanceConfigs may have the same name.
- No two InstanceConfigs may have the same positions path.
- No InstanceConfig may have an empty name.
- If InstanceConfig positions path is empty, shared PositionsDirectory must not be empty.
Defaults:
- If a positions config is empty, it will be generated based on the InstanceConfig name and Config.PositionsDirectory.
- If an InstanceConfigs's ClientConfigs is empty, it will be generated based on the Config.GlobalConfig.ClientConfigs.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.
type GlobalConfig ¶
type GlobalConfig struct { FileWatch file.WatchConfig `yaml:"file_watch_config,omitempty"` ClientConfigs []client.Config `yaml:"clients,omitempty"` }
GlobalConfig holds global settings that apply to all instances by default.
func (GlobalConfig) IsZero ¶
func (c GlobalConfig) IsZero() bool
func (*GlobalConfig) UnmarshalYAML ¶
func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements yaml.Unmarshaler.
type InstanceConfig ¶
type InstanceConfig struct { Name string `yaml:"name,omitempty"` ClientConfigs []client.Config `yaml:"clients,omitempty"` PositionsConfig positions.Config `yaml:"positions,omitempty"` ScrapeConfig []scrapeconfig.Config `yaml:"scrape_configs,omitempty"` TargetConfig file.Config `yaml:"target_config,omitempty"` LimitsConfig limit.Config `yaml:"limits_config,omitempty"` }
InstanceConfig is an individual Promtail config.
func (*InstanceConfig) Initialize ¶
func (c *InstanceConfig) Initialize()
func (*InstanceConfig) UnmarshalYAML ¶
func (c *InstanceConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements yaml.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.