Documentation ¶
Index ¶
- func RegisterPlugin(name string, plugin Plugin)
- func SetupPlugins(flagSet *pflag.FlagSet)
- type GlobalConfig
- type KubernetesSDConfig
- type KubernetesSDConfigList
- type Plugin
- type PluginUpdate
- type PrometheusConfig
- type RelabelConfig
- type RelabelConfigList
- type ScrapeConfig
- type ScrapeConfigList
- type Service
- type ServiceConfig
- type ServiceDependencies
- type StaticConfig
- type StaticConfigList
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPlugin ¶
func SetupPlugins ¶
Types ¶
type GlobalConfig ¶
type KubernetesSDConfig ¶
type KubernetesSDConfig struct {
Role string `yaml:"role"`
}
type KubernetesSDConfigList ¶
type KubernetesSDConfigList []KubernetesSDConfig
type Plugin ¶
type Plugin interface { // Configure the command line flags needed by the plugin. Setup(flagSet *pflag.FlagSet) // Start the plugin. Send a value on the given channel to trigger an update of the configuration. // Use a go-routine internally since this method is blocking. Start(config ServiceConfig, trigger chan string) error // Update the data of the plugin so a new configuration can be build. Update() (PluginUpdate, error) }
type PluginUpdate ¶
type PluginUpdate interface { // CreateNodes creates all scrape configurations this plugin is aware of. CreateNodes() ([]ScrapeConfig, error) // CreateRules creates all rules this plugin is aware of. // The returns string list should contain the content of the various rules. CreateRules() ([]string, error) }
type PrometheusConfig ¶
type PrometheusConfig struct { Global GlobalConfig `yaml:"global"` RuleFiles []string `yaml:"rule_files,omitempty"` ScrapeConfigs ScrapeConfigList `yaml:"scrape_configs"` }
func (*PrometheusConfig) Sort ¶
func (pc *PrometheusConfig) Sort()
type RelabelConfig ¶
type RelabelConfig struct { SourceLabels []string `yaml:"source_labels,omitempty"` Separator string `yaml:"separator,omitempty"` TargetLabel string `yaml:"target_label,omitempty"` Regex string `yaml:"regex,omitempty"` Modulus uint64 `yaml:"modulus,omitempty"` Replacement string `yaml:"replacement,omitempty"` Action string `yaml:"action,omitempty"` }
type RelabelConfigList ¶
type RelabelConfigList []RelabelConfig
type ScrapeConfig ¶
type ScrapeConfig struct { JobName string `yaml:"job_name"` ScrapeInterval string `yaml:"scrape_interval,omitempty"` HonorLabels bool `yaml:"honor_labels,omitempty"` MetricsPath string `yaml:"metrics_path,omitempty"` Scheme string `yaml:"scheme,omitempty"` StaticConfigs StaticConfigList `yaml:"static_configs,omitempty"` KubernetesConfigs KubernetesSDConfigList `yaml:"kubernetes_sd_configs,omitempty"` TLSConfig *TLSConfig `yaml:"tls_config,omitempty"` RelabelConfigs RelabelConfigList `yaml:"relabel_configs,omitempty"` }
func (*ScrapeConfig) Sort ¶
func (sc *ScrapeConfig) Sort()
type ScrapeConfigList ¶
type ScrapeConfigList []ScrapeConfig
func (ScrapeConfigList) Len ¶
func (l ScrapeConfigList) Len() int
func (ScrapeConfigList) Less ¶
func (l ScrapeConfigList) Less(i, j int) bool
func (ScrapeConfigList) Swap ¶
func (l ScrapeConfigList) Swap(i, j int)
type Service ¶
type Service struct { ServiceConfig ServiceDependencies // contains filtered or unexported fields }
func NewService ¶
func NewService(config ServiceConfig, deps ServiceDependencies) *Service
type ServiceConfig ¶
type ServiceDependencies ¶
type ServiceDependencies struct {
Log *logging.Logger
}
type StaticConfig ¶
type StaticConfig struct { Targets []string `yaml:"targets,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` }
func (*StaticConfig) FullString ¶
func (tg *StaticConfig) FullString() string
func (*StaticConfig) Label ¶
func (tg *StaticConfig) Label(name, value string)
func (*StaticConfig) Sort ¶
func (tg *StaticConfig) Sort()
type StaticConfigList ¶
type StaticConfigList []StaticConfig
func (StaticConfigList) Len ¶
func (l StaticConfigList) Len() int
func (StaticConfigList) Less ¶
func (l StaticConfigList) Less(i, j int) bool
func (StaticConfigList) Swap ¶
func (l StaticConfigList) Swap(i, j int)
type TLSConfig ¶
type TLSConfig struct { CAFile string `yaml:"ca_file,omitempty"` CertFile string `yaml:"cert_file,omitempty"` KeyFile string `yaml:"key_file,omitempty"` ServerName string `yaml:"server_name,omitempty"` InsecureSkipVerify bool `yaml:"insecure_skip_verify,omitempty"` }
func (TLSConfig) IsConfigured ¶
IsConfigured returns true if there is a non-empty configuration in the given TLSConfig.
Click to show internal directories.
Click to hide internal directories.