Documentation ¶
Index ¶
- func LoadConfigFromFile(config *Config, filename string) error
- func LoadConfigFromFlags(config *Config, flags *StartupFlags) error
- func LoadConfigFromStream(config *Config, stream io.Reader, typ ConfigType) error
- type Config
- type ConfigType
- type ConsulConfig
- type ConsulServiceConfig
- type ListenConfig
- type NamespaceConfig
- type RelabelConfig
- type RelabelValueMatch
- type StartupFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfigFromFile ¶
LoadConfigFromFile fills a configuration object (passed as parameter) with values read from a configuration file (pass as parameter by filename). The configuration file needs to be in HCL format.
func LoadConfigFromFlags ¶
func LoadConfigFromFlags(config *Config, flags *StartupFlags) error
LoadConfigFromFlags fills a configuration object (passed as parameter) with values from command-line flags.
func LoadConfigFromStream ¶ added in v1.2.0
func LoadConfigFromStream(config *Config, stream io.Reader, typ ConfigType) error
LoadConfigFromStream fills a configuration object (passed as parameter) with values read from a Reader interface (passed as parameter).
Types ¶
type Config ¶
type Config struct { Listen ListenConfig Consul ConsulConfig Namespaces []NamespaceConfig `hcl:"namespace"` EnableExperimentalFeatures bool `hcl:"enable_experimental"` }
Config models the application's configuration
func (*Config) StabilityWarnings ¶ added in v1.1.0
type ConfigType ¶ added in v1.2.0
type ConfigType int
const ( TYPE_HCL ConfigType = iota TYPE_YAML )
type ConsulConfig ¶
type ConsulServiceConfig ¶
type ListenConfig ¶
ListenConfig is a struct describing the built-in webserver configuration
type NamespaceConfig ¶
type NamespaceConfig struct { Name string `hcl:",key"` SourceFiles []string `hcl:"source_files" yaml:"source_files"` Format string `hcl:"format"` Labels map[string]string `hcl:"labels"` RelabelConfigs []RelabelConfig `hcl:"relabel" yaml:"relabel_configs"` OrderedLabelNames []string OrderedLabelValues []string }
NamespaceConfig is a struct describing single metric namespaces
func (*NamespaceConfig) Compile ¶ added in v1.1.0
func (c *NamespaceConfig) Compile() error
func (*NamespaceConfig) MustCompile ¶ added in v1.1.0
func (c *NamespaceConfig) MustCompile()
func (*NamespaceConfig) OrderLabels ¶ added in v1.0.1
func (c *NamespaceConfig) OrderLabels()
OrderLabels builds two lists of label keys and values, ordered by label name
func (*NamespaceConfig) StabilityWarnings ¶ added in v1.1.0
func (c *NamespaceConfig) StabilityWarnings() error
type RelabelConfig ¶ added in v1.1.0
type RelabelConfig struct { TargetLabel string `hcl:",key" yaml:"target_label"` SourceValue string `hcl:"from" yaml:"from"` Whitelist []string `hcl:"whitelist"` Matches []RelabelValueMatch `hcl:"match"` Split int `hcl:"split"` WhitelistExists bool WhitelistMap map[string]interface{} }
RelabelConfig is a struct describing a single re-labeling configuration for taking over label values from an access log line into a Prometheus metric
func (*RelabelConfig) Compile ¶ added in v1.1.0
func (c *RelabelConfig) Compile() error