Documentation ¶
Index ¶
- Constants
- Variables
- func CensorSecretItem(key string, value interface{}) interface{}
- func DefaultPaths() []string
- func Dump(config Config) map[string]interface{}
- func Load(withDefault bool, loadEnviron bool, paths ...string) (Config, []Item, prometheus.MultiError, error)
- func ParseBool(value string) (bool, error)
- type Agent
- type Blackbox
- type BlackboxTarget
- type Bleemeo
- type BleemeoCache
- type BleemeoMQTT
- type Config
- type Container
- type ContainerFilter
- type ContainerRuntime
- type ContainerRuntimeAddresses
- type DF
- type DFFSTypeMatcher
- type DFPathMatcher
- type DiskIOMatcher
- type IPMI
- type Item
- type ItemSource
- type ItemType
- type JMX
- type JMXTrans
- type JmxMetric
- type Kubernetes
- type Listener
- type LocalUI
- type Log
- type LogFilter
- type LogInput
- type Logging
- type LoggingBuffer
- type Mdstat
- type Metric
- type NRPE
- type NameInstance
- type NetworkInterfaceMatcher
- type NodeExporter
- type NvidiaSMI
- type OpenSourceMQTT
- type ProcessExporter
- type Prometheus
- type PrometheusTarget
- type SNMP
- type SNMPTarget
- type Sentry
- type Service
- type Smart
- type StatsD
- type Telegraf
- type Telemetry
- type Threshold
- type VSphere
- type Web
- type WebEndpoints
- type Zabbix
Constants ¶
const ( // Tag used to unmarshal the config. // We need to use the "yaml" tag instead of the default "koanf" tag because // the config embeds the blackbox module config which uses YAML. Tag = "yaml" EnvGloutonConfigFiles = "GLOUTON_CONFIG_FILES" )
Variables ¶
var (
ErrInvalidValue = errors.New("invalid config value")
)
Functions ¶
func CensorSecretItem ¶
func CensorSecretItem(key string, value interface{}) interface{}
CensorSecretItem returns the censored item value with secrets and password removed for safe external use.
func DefaultPaths ¶
func DefaultPaths() []string
DefaultPaths returns the default paths used to search for config files.
func Dump ¶
Dump return a copy of the whole configuration, with secrets retracted. secret is any key containing "key", "secret", "password" or "passwd".
func Load ¶
func Load(withDefault bool, loadEnviron bool, paths ...string) (Config, []Item, prometheus.MultiError, error)
Load the configuration from files and environment variables. It returns the config, the loaded items, warnings and an error.
Types ¶
type Agent ¶
type Agent struct { CloudImageCreationFile string `yaml:"cloudimage_creation_file"` InstallationFormat string `yaml:"installation_format"` FactsFile string `yaml:"facts_file"` NetstatFile string `yaml:"netstat_file"` StateFile string `yaml:"state_file"` StateCacheFile string `yaml:"state_cache_file"` StateResetFile string `yaml:"state_reset_file"` DeprecatedStateFile string `yaml:"deprecated_state_file"` StateDirectory string `yaml:"state_directory"` EnableCrashReporting bool `yaml:"enable_crash_reporting"` MaxCrashReportsCount int `yaml:"max_crash_reports_count"` UpgradeFile string `yaml:"upgrade_file"` AutoUpgradeFile string `yaml:"auto_upgrade_file"` ProcessExporter ProcessExporter `yaml:"process_exporter"` PublicIPIndicator string `yaml:"public_ip_indicator"` NodeExporter NodeExporter `yaml:"node_exporter"` WindowsExporter NodeExporter `yaml:"windows_exporter"` Telemetry Telemetry `yaml:"telemetry"` }
type BlackboxTarget ¶
type Bleemeo ¶
type Bleemeo struct { AccountID string `yaml:"account_id"` APIBase string `yaml:"api_base"` APISSLInsecure bool `yaml:"api_ssl_insecure"` Cache BleemeoCache `yaml:"cache"` ContainerRegistrationDelaySeconds int `yaml:"container_registration_delay_seconds"` Enable bool `yaml:"enable"` InitialAgentName string `yaml:"initial_agent_name"` InitialServerGroupName string `yaml:"initial_server_group_name"` InitialServerGroupNameForSNMP string `yaml:"initial_server_group_name_for_snmp"` InitialServerGroupNameForVSphere string `yaml:"initial_server_group_name_for_vsphere"` MQTT BleemeoMQTT `yaml:"mqtt"` RegistrationKey string `yaml:"registration_key"` Sentry Sentry `yaml:"sentry"` }
type BleemeoCache ¶
type BleemeoCache struct {
DeactivatedMetricsExpirationDays int `yaml:"deactivated_metrics_expiration_days"`
}
type BleemeoMQTT ¶
type Config ¶
type Config struct { Agent Agent `yaml:"agent"` Blackbox Blackbox `yaml:"blackbox"` Bleemeo Bleemeo `yaml:"bleemeo"` Container Container `yaml:"container"` DF DF `yaml:"df"` DiskIgnore []string `yaml:"disk_ignore"` DiskMonitor []string `yaml:"disk_monitor"` IPMI IPMI `yaml:"ipmi"` JMX JMX `yaml:"jmx"` JMXTrans JMXTrans `yaml:"jmxtrans"` Kubernetes Kubernetes `yaml:"kubernetes"` Log Log `yaml:"log"` Logging Logging `yaml:"logging"` Mdstat Mdstat `yaml:"mdstat"` Metric Metric `yaml:"metric"` MQTT OpenSourceMQTT `yaml:"mqtt"` NetworkInterfaceDenylist []string `yaml:"network_interface_denylist"` NRPE NRPE `yaml:"nrpe"` NvidiaSMI NvidiaSMI `yaml:"nvidia_smi"` Services []Service `yaml:"service"` ServiceAbsentDeactivationDelay time.Duration `yaml:"service_absent_deactivation_delay"` ServiceIgnore []NameInstance `yaml:"service_ignore"` ServiceIgnoreMetrics []NameInstance `yaml:"service_ignore_metrics"` ServiceIgnoreCheck []NameInstance `yaml:"service_ignore_check"` Smart Smart `yaml:"smart"` Tags []string `yaml:"tags"` Telegraf Telegraf `yaml:"telegraf"` Thresholds map[string]Threshold `yaml:"thresholds"` VSphere []VSphere `yaml:"vsphere"` Web Web `yaml:"web"` Zabbix Zabbix `yaml:"zabbix"` }
Config is the structured configuration of the agent.
func DefaultConfig ¶
func DefaultConfig() Config
type Container ¶
type Container struct { Filter ContainerFilter `yaml:"filter"` Type string `yaml:"type"` PIDNamespaceHost bool `yaml:"pid_namespace_host"` Runtime ContainerRuntime `yaml:"runtime"` }
type ContainerFilter ¶
type ContainerRuntime ¶
type ContainerRuntime struct { Docker ContainerRuntimeAddresses `yaml:"docker"` ContainerD ContainerRuntimeAddresses `yaml:"containerd"` }
type DFFSTypeMatcher ¶
type DFFSTypeMatcher struct {
// contains filtered or unexported fields
}
func NewDFFSTypeMatcher ¶
func NewDFFSTypeMatcher(config Config) (DFFSTypeMatcher, error)
func (DFFSTypeMatcher) AsDenyRegexp ¶
func (f DFFSTypeMatcher) AsDenyRegexp() string
func (DFFSTypeMatcher) Match ¶
func (f DFFSTypeMatcher) Match(fsType string) bool
type DFPathMatcher ¶
type DFPathMatcher struct {
// contains filtered or unexported fields
}
func NewDFPathMatcher ¶
func NewDFPathMatcher(config Config) DFPathMatcher
func (DFPathMatcher) Match ¶
func (f DFPathMatcher) Match(path string) bool
type DiskIOMatcher ¶
type DiskIOMatcher struct {
// contains filtered or unexported fields
}
func NewDiskIOMatcher ¶
func NewDiskIOMatcher(config Config) (DiskIOMatcher, error)
func (DiskIOMatcher) AsDenyRegexp ¶
func (f DiskIOMatcher) AsDenyRegexp() string
AsDenyRegexp return a regexp as string that should be used as denylist: any value that match this regexp should be ignored. If the denylist is empty, this regexp won't correspond to Match() method.
func (DiskIOMatcher) Match ¶
func (f DiskIOMatcher) Match(disk string) bool
type Item ¶
type Item struct { // The config Key (e.g. "bleemeo.enable"). Key string // The Value for this config key. Value interface{} // Type of the value. Type ItemType // Source of the config key (can be a default value, an environment variable or a file). Source ItemSource // Path to the file the item comes (empty when it doesn't come from a file). Path string // Priority of the item. // When two items have the same key, the one with the highest Priority is kept. // When the value is a map or an array, the items may have the same Priority, in // this case the arrays are appended to each other, and the maps are merged. Priority int }
Item represents a single config key from a provider.
type ItemSource ¶
type ItemSource int
ItemSource represents the ItemSource of an item.
const ( SourceDefault ItemSource = iota SourceEnv SourceFile )
type Kubernetes ¶
type Logging ¶
type Logging struct { Buffer LoggingBuffer `yaml:"buffer"` Level string `yaml:"level"` Output string `yaml:"output"` FileName string `yaml:"filename"` PackageLevels string `yaml:"package_levels"` }
type LoggingBuffer ¶
type Metric ¶
type Metric struct { AllowMetrics []string `yaml:"allow_metrics"` DenyMetrics []string `yaml:"deny_metrics"` IncludeDefaultMetrics bool `yaml:"include_default_metrics"` Prometheus Prometheus `yaml:"prometheus"` SoftStatusPeriodDefault int `yaml:"softstatus_period_default"` SoftStatusPeriod map[string]int `yaml:"softstatus_period"` SNMP SNMP `yaml:"snmp"` }
type NameInstance ¶
type NetworkInterfaceMatcher ¶
type NetworkInterfaceMatcher struct {
// contains filtered or unexported fields
}
func NewNetworkInterfaceMatcher ¶
func NewNetworkInterfaceMatcher(config Config) NetworkInterfaceMatcher
func (NetworkInterfaceMatcher) AsDenyRegexp ¶
func (f NetworkInterfaceMatcher) AsDenyRegexp() string
func (NetworkInterfaceMatcher) Match ¶
func (f NetworkInterfaceMatcher) Match(netif string) bool
type NodeExporter ¶
type OpenSourceMQTT ¶
type ProcessExporter ¶
type ProcessExporter struct {
Enable bool `yaml:"enable"`
}
type Prometheus ¶
type Prometheus struct {
Targets []PrometheusTarget `yaml:"targets"`
}
type PrometheusTarget ¶
type SNMP ¶
type SNMP struct { ExporterAddress string `yaml:"exporter_address"` Targets []SNMPTarget `yaml:"targets"` }
type SNMPTarget ¶
type Service ¶
type Service struct { // The name of the service type, like "apache", "nginx". For custom service, it could be any value. Type string `yaml:"type"` // Instance of the service, used to differentiate between two same services (like two apaches) Instance string `yaml:"instance"` // The port the service is running on. Port int `yaml:"port"` // Ports that should be ignored. IgnorePorts []int `yaml:"ignore_ports"` // The address of the service. Address string `yaml:"address"` // Tags associated with this service. Tags []string `yaml:"tags"` // The delay between two consecutive checks in seconds. Interval int `yaml:"interval"` // Check type used for custom checks. CheckType string `yaml:"check_type"` // The path used for HTTP checks. HTTPPath string `yaml:"http_path"` // The expected status code for HTTP checks. HTTPStatusCode int `yaml:"http_status_code"` // Host header sent with HTTP checks. HTTPHost string `yaml:"http_host"` // Regex to match in a process check. MatchProcess string `yaml:"match_process"` // Command used for a Nagios check. CheckCommand string `yaml:"check_command"` NagiosNRPEName string `yaml:"nagios_nrpe_name"` // Unix socket to connect and gather metric from MySQL. MetricsUnixSocket string `yaml:"metrics_unix_socket"` // Credentials for services that require authentication. Username string `yaml:"username"` Password string `yaml:"password"` // URL used to retrieve metrics (used for instance by HAProxy and PHP-FMP). StatsURL string `yaml:"stats_url"` // Port used to get statistics for a service. StatsPort int `yaml:"stats_port"` // Protocol used to get statistics (TCP, HTTP). StatsProtocol string `yaml:"stats_protocol"` // Detailed monitoring of specific items (Cassandra tables, Postgres databases or Kafka topics). DetailedItems []string `yaml:"detailed_items"` // JMX services. JMXPort int `yaml:"jmx_port"` JMXUsername string `yaml:"jmx_username"` JMXPassword string `yaml:"jmx_password"` JMXMetrics []JmxMetric `yaml:"jmx_metrics"` // TLS config. SSL bool `yaml:"ssl"` SSLInsecure bool `yaml:"ssl_insecure"` StartTLS bool `yaml:"starttls"` CAFile string `yaml:"ca_file"` CertFile string `yaml:"cert_file"` KeyFile string `yaml:"key_file"` // IncludedItems or exclude specific items (for instance Jenkins jobs). IncludedItems []string `yaml:"included_items"` ExcludedItems []string `yaml:"excluded_items"` }
type Web ¶
type Web struct { Enable bool `yaml:"enable"` Endpoints WebEndpoints `yaml:"endpoints"` LocalUI LocalUI `yaml:"local_ui"` Listener Listener `yaml:"listener"` StaticCDNURL string `yaml:"static_cdn_url"` }
type WebEndpoints ¶
type WebEndpoints struct {
DebugEnable bool `yaml:"debug_enable"`
}