Documentation ¶
Index ¶
- Constants
- Variables
- func Expand(nv string) string
- func FileScanPeriod() int
- func GetConcurrency() int
- func GetContainerCollectAll() bool
- func GetContainerExcludeList() []string
- func GetContainerIncludeList() []string
- func GetEnv(key string) string
- func GetInterval() time.Duration
- func GetLogReadTimeout() int
- func GetLogRunPath() string
- func GetOutboundIP() (net.IP, error)
- func GlobalLabels() map[string]string
- func InitConfig(configDir string, debugMode, testMode bool, interval int64, ...) error
- func InitHostInfo() error
- func IsFeaturePresent(t string) bool
- func LogFrameSize() int
- func OpenLogsLimit() int
- func ValidatePodContainerID() bool
- type ConfigType
- type Duration
- type Global
- type HTTP
- type HTTPCommonConfig
- type HTTPProviderConfig
- type HTTPProxy
- type HeartbeatConfig
- type HostInfoCache
- type IbexConfig
- type InstanceConfig
- type InternalConfig
- type KafkaConfig
- type KubeConfig
- type Log
- type Logs
- type PluginConfig
- type ProcessorEnum
- type Prometheus
- type RelabelConfig
- type UrlLabel
- type WriterOpt
- type WriterOption
Constants ¶
View Source
const ( Docker = "docker" Kubernetes = "kubernetes" )
Variables ¶
View Source
var Version = "unknown"
Functions ¶
func FileScanPeriod ¶
func FileScanPeriod() int
func GetConcurrency ¶
func GetConcurrency() int
func GetContainerCollectAll ¶
func GetContainerCollectAll() bool
func GetContainerExcludeList ¶
func GetContainerExcludeList() []string
func GetContainerIncludeList ¶
func GetContainerIncludeList() []string
func GetInterval ¶
func GetLogReadTimeout ¶
func GetLogReadTimeout() int
func GetLogRunPath ¶
func GetLogRunPath() string
func GlobalLabels ¶
func InitConfig ¶
func InitHostInfo ¶
func InitHostInfo() error
func IsFeaturePresent ¶
func LogFrameSize ¶
func LogFrameSize() int
func OpenLogsLimit ¶
func OpenLogsLimit() int
func ValidatePodContainerID ¶
func ValidatePodContainerID() bool
Types ¶
type ConfigType ¶
type ConfigType struct { // from console args ConfigDir string DebugMode bool TestMode bool InputFilters string // from config.toml Global Global `toml:"global"` WriterOpt WriterOpt `toml:"writer_opt"` Writers []WriterOption `toml:"writers"` Logs Logs `toml:"logs"` Traces *traces.Config `toml:"traces"` HTTP *HTTP `toml:"http"` Prometheus *Prometheus `toml:"prometheus"` Ibex *IbexConfig `toml:"ibex"` Heartbeat *HeartbeatConfig `toml:"heartbeat"` Log Log `toml:"log"` HTTPProviderConfig *HTTPProviderConfig `toml:"http_provider"` }
var Config *ConfigType
func (*ConfigType) GetHostIP ¶
func (c *ConfigType) GetHostIP() string
func (*ConfigType) GetHostname ¶
func (c *ConfigType) GetHostname() string
type Duration ¶
Duration is a time.Duration
func (*Duration) UnmarshalTOML ¶
UnmarshalTOML parses the duration from the TOML config file
func (*Duration) UnmarshalText ¶
type Global ¶
type Global struct { PrintConfigs bool `toml:"print_configs"` Hostname string `toml:"hostname"` OmitHostname bool `toml:"omit_hostname"` Labels map[string]string `toml:"labels"` Precision string `toml:"precision"` Interval Duration `toml:"interval"` Providers []string `toml:"providers"` Concurrency int `toml:"concurrency"` }
type HTTP ¶
type HTTP struct { Enable bool `toml:"enable"` Address string `toml:"address"` PrintAccess bool `toml:"print_access"` RunMode string `toml:"run_mode"` CertFile string `toml:"cert_file"` KeyFile string `toml:"key_file"` ReadTimeout int `toml:"read_timeout"` WriteTimeout int `toml:"write_timeout"` IdleTimeout int `toml:"idle_timeout"` }
type HTTPCommonConfig ¶
type HTTPCommonConfig struct { Method string `toml:"method"` Username string `toml:"username"` Password string `toml:"password"` Body string `toml:"body"` Headers map[string]string `toml:"headers"` Timeout Duration `toml:"timeout"` FollowRedirects *bool `toml:"follow_redirects"` DisableKeepAlives *bool `toml:"disable_keepalives"` tls.ClientConfig HTTPProxy // contains filtered or unexported fields }
func (*HTTPCommonConfig) GetBody ¶
func (hcc *HTTPCommonConfig) GetBody() io.Reader
func (*HTTPCommonConfig) InitHTTPClientConfig ¶
func (hcc *HTTPCommonConfig) InitHTTPClientConfig()
func (*HTTPCommonConfig) SetHeaders ¶
func (hcc *HTTPCommonConfig) SetHeaders(req *http.Request)
type HTTPProviderConfig ¶
type HeartbeatConfig ¶
type HeartbeatConfig struct { Enable bool `toml:"enable"` Url string `toml:"url"` Interval int64 `toml:"interval"` BasicAuthUser string `toml:"basic_auth_user"` BasicAuthPass string `toml:"basic_auth_pass"` Headers []string `toml:"headers"` Timeout int64 `toml:"timeout"` DialTimeout int64 `toml:"dial_timeout"` MaxIdleConnsPerHost int `toml:"max_idle_conns_per_host"` HTTPProxy tls.ClientConfig }
type HostInfoCache ¶
var HostInfo *HostInfoCache
func (*HostInfoCache) GetHostname ¶
func (c *HostInfoCache) GetHostname() string
func (*HostInfoCache) GetIP ¶
func (c *HostInfoCache) GetIP() string
func (*HostInfoCache) SetHostname ¶
func (c *HostInfoCache) SetHostname(name string)
func (*HostInfoCache) SetIP ¶
func (c *HostInfoCache) SetIP(ip string)
type IbexConfig ¶
type InstanceConfig ¶
type InstanceConfig struct { InternalConfig IntervalTimes int64 `toml:"interval_times"` }
func (*InstanceConfig) GetIntervalTimes ¶
func (ic *InstanceConfig) GetIntervalTimes() int64
type InternalConfig ¶
type InternalConfig struct { // append labels Labels map[string]string `toml:"labels"` // metrics drop and pass filter MetricsDrop []string `toml:"metrics_drop"` MetricsPass []string `toml:"metrics_pass"` MetricsDropFilter filter.Filter MetricsPassFilter filter.Filter // metric name prefix MetricsNamePrefix string `toml:"metrics_name_prefix"` // mapping value ProcessorEnum []*ProcessorEnum `toml:"processor_enum"` RelabelConfigs []*RelabelConfig `toml:"relabel_configs"` // contains filtered or unexported fields }
func (*InternalConfig) GetLabels ¶
func (ic *InternalConfig) GetLabels() map[string]string
func (*InternalConfig) InitInternalConfig ¶
func (ic *InternalConfig) InitInternalConfig() error
func (*InternalConfig) Initialized ¶
func (ic *InternalConfig) Initialized() bool
func (*InternalConfig) Process ¶
func (ic *InternalConfig) Process(slist *types.SampleList) *types.SampleList
func (*InternalConfig) SetInitialized ¶
func (ic *InternalConfig) SetInitialized()
type KafkaConfig ¶
type KubeConfig ¶
type KubeConfig struct { KubeletHTTPPort int `json:"kubernetes_http_kubelet_port" toml:"kubernetes_http_kubelet_port"` KubeletHTTPSPort int `json:"kubernetes_https_kubelet_port" toml:"kubernetes_https_kubelet_port"` KubeletTokenPath string `json:"kubelet_auth_token_path" toml:"kubelet_auth_token_path"` KubeletCAPath string `json:"kubelet_client_ca" toml:"kubelet_client_ca"` }
type Logs ¶
type Logs struct { APIKey string `json:"api_key" toml:"api_key"` Enable bool `json:"enable" toml:"enable"` SendTo string `json:"send_to" toml:"send_to"` SendType string `json:"send_type" toml:"send_type"` UseCompression bool `json:"use_compression" toml:"use_compression"` CompressionLevel int `json:"compression_level" toml:"compression_level"` SendWithTLS bool `json:"send_with_tls" toml:"send_with_tls"` BatchWait int `json:"batch_wait" toml:"batch_wait"` RunPath string `json:"run_path" toml:"run_path"` OpenFilesLimit int `json:"open_files_limit" toml:"open_files_limit"` ScanPeriod int `json:"scan_period" toml:"scan_period"` FrameSize int `json:"frame_size" toml:"frame_size"` CollectContainerAll bool `json:"collect_container_all" toml:"collect_container_all"` ContainerInclude []string `json:"container_include" toml:"container_include"` ContainerExclude []string `json:"container_exclude" toml:"container_exclude"` GlobalProcessingRules []*logsconfig.ProcessingRule `json:"processing_rules" toml:"processing_rules"` Items []*logsconfig.LogsConfig `json:"items" toml:"items"` KafkaConfig KubeConfig }
type PluginConfig ¶
type PluginConfig struct { InternalConfig Interval Duration `toml:"interval"` }
func (*PluginConfig) GetInterval ¶
func (pc *PluginConfig) GetInterval() Duration
type ProcessorEnum ¶
type Prometheus ¶
type RelabelConfig ¶
type RelabelConfig struct { // A list of labels from which values are taken and concatenated // with the configured separator in order. SourceLabels model.LabelNames `toml:"source_labels,flow,omitempty"` // Separator is the string between concatenated values from the source labels. Separator string `toml:"separator,omitempty"` // Regex against which the concatenation is matched. Regex string `toml:"regex,omitempty"` // Modulus to take of the hash of concatenated values from the source labels. Modulus uint64 `toml:"modulus,omitempty"` // TargetLabel is the label to which the resulting string is written in a replacement. // Regexp interpolation is allowed for the replace action. TargetLabel string `toml:"target_label,omitempty"` // Replacement is the regex replacement pattern to be used. Replacement string `toml:"replacement,omitempty"` // Action is the action to be performed for the relabeling. Action relabel.Action `toml:"action,omitempty"` }
type UrlLabel ¶
type UrlLabel struct { LabelKey string `toml:"url_label_key"` LabelValue string `toml:"url_label_value"` LabelValueTpl *template.Template LabelPair map[string]string `toml:"url_label_pair"` LabelPairTpl *template.Template `toml:"-"` }
func (*UrlLabel) GenerateLabel ¶
func (*UrlLabel) PrepareUrlTemplate ¶
type WriterOption ¶
type WriterOption struct { Url string `toml:"url"` BasicAuthUser string `toml:"basic_auth_user"` BasicAuthPass string `toml:"basic_auth_pass"` Headers []string `toml:"headers"` Timeout int64 `toml:"timeout"` DialTimeout int64 `toml:"dial_timeout"` MaxIdleConnsPerHost int `toml:"max_idle_conns_per_host"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.