Documentation
¶
Overview ¶
Package metrics implements a Prometheus-lite client for service discovery, scraping metrics into a WAL, and remote_write. Clients are broken into a set of instances, each of which contain their own set of configs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Global: instance.DefaultGlobalConfig, InstanceRestartBackoff: 5 * time.Second, WALDir: "data-agent/", WALCleanupAge: 12 * time.Hour, WALCleanupPeriod: 30 * time.Minute, ServiceConfig: cluster.DefaultConfig, ServiceClientConfig: client.DefaultConfig, InstanceMode: instance.DefaultMode, }
DefaultConfig is the default settings for the Prometheus-lite client.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Global instance.GlobalConfig `yaml:"global,omitempty"`
WALDir string `yaml:"wal_directory,omitempty"`
WALCleanupAge time.Duration `yaml:"wal_cleanup_age,omitempty"`
WALCleanupPeriod time.Duration `yaml:"wal_cleanup_period,omitempty"`
ServiceConfig cluster.Config `yaml:"scraping_service,omitempty"`
ServiceClientConfig client.Config `yaml:"scraping_service_client,omitempty"`
Configs []instance.Config `yaml:"configs,omitempty"`
InstanceRestartBackoff time.Duration `yaml:"instance_restart_backoff,omitempty"`
InstanceMode instance.Mode `yaml:"instance_mode,omitempty"`
DisableKeepAlives bool `yaml:"http_disable_keepalives,omitempty"`
IdleConnTimeout time.Duration `yaml:"http_idle_conn_timeout,omitempty"`
// Unmarshaled is true when the Config was unmarshaled from YAML.
Unmarshaled bool `yaml:"-"`
}
Config defines the configuration for the entire set of Prometheus client instances, along with a global configuration.
func (*Config) ApplyDefaults ¶
ApplyDefaults applies default values to the Config and validates it.
func (*Config) RegisterFlags ¶
RegisterFlags defines flags corresponding to the Config.
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix defines flags with the provided prefix.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.