Documentation ¶
Overview ¶
Package instance provides a mini Prometheus scraper and remote_writer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultConfig = Config{ HostFilter: false, WALTruncateFrequency: 60 * time.Minute, MinWALTime: 5 * time.Minute, MaxWALTime: 4 * time.Hour, RemoteFlushDeadline: 1 * time.Minute, WriteStaleOnShutdown: false, // contains filtered or unexported fields } )
Default configuration values
var DefaultGlobalConfig = GlobalConfig{ Prometheus: config.DefaultGlobalConfig, }
DefaultGlobalConfig holds default global settings to be used across all instances.
Functions ¶
func MarshalConfig ¶
MarshalConfig marshals an instance config based on a provided content type.
Types ¶
type Config ¶
type Config struct { Name string `yaml:"name,omitempty"` HostFilter bool `yaml:"host_filter,omitempty"` HostFilterRelabelConfigs []*relabel.Config `yaml:"host_filter_relabel_configs,omitempty"` ScrapeConfigs []*config.ScrapeConfig `yaml:"scrape_configs,omitempty"` RemoteWrite []*config.RemoteWriteConfig `yaml:"remote_write,omitempty"` // How frequently the WAL should be truncated. WALTruncateFrequency time.Duration `yaml:"wal_truncate_frequency,omitempty"` // Minimum and maximum time series should exist in the WAL for. MinWALTime time.Duration `yaml:"min_wal_time,omitempty"` MaxWALTime time.Duration `yaml:"max_wal_time,omitempty"` RemoteFlushDeadline time.Duration `yaml:"remote_flush_deadline,omitempty"` WriteStaleOnShutdown bool `yaml:"write_stale_on_shutdown,omitempty"` // contains filtered or unexported fields }
Config is a specific agent that runs within the overall Prometheus agent. It has its own set of scrape_configs and remote_write rules.
func UnmarshalConfig ¶
UnmarshalConfig unmarshals an instance config from a reader based on a provided content type.
func (*Config) ApplyDefaults ¶
func (c *Config) ApplyDefaults(global GlobalConfig) error
ApplyDefaults applies default configurations to the configuration to all values that have not been changed to their non-zero value. ApplyDefaults also validates the config.
The value for global will be saved.
func (Config) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.
type GlobalConfig ¶
type GlobalConfig struct { Prometheus config.GlobalConfig `yaml:",inline"` RemoteWrite []*config.RemoteWriteConfig `yaml:"remote_write,omitempty"` ExtraMetrics bool `yaml:"-"` DisableKeepAlives bool `yaml:"-"` IdleConnTimeout time.Duration `yaml:"-"` }
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 Mode ¶
type Mode string
Mode controls how instances are created.
var ( ModeDistinct Mode = "distinct" DefaultMode = ModeShared )
Types of instance modes
func (*Mode) UnmarshalYAML ¶
UnmarshalYAML unmarshals a string to a Mode. Fails if the string is unrecognized.