Documentation ¶
Index ¶
- Variables
- func Add(name string, creator Creator)
- func Collect(e prometheus.Collector, slist *types.SampleList, ...) error
- func FormatInputName(provider, inputKey string) string
- func MayDrop(t interface{})
- func MayGather(t interface{}, slist *types.SampleList)
- func MayInit(t interface{}) error
- func ParseInputName(name string) (string, string)
- type Cloneable
- type Creator
- type Dropper
- type HTTPProvider
- func (hrp *HTTPProvider) GetInputConfig(inputKey string) ([]cfg.ConfigWithFormat, error)
- func (hrp *HTTPProvider) GetInputs() ([]string, error)
- func (hrp *HTTPProvider) LoadConfig() (bool, error)
- func (hrp *HTTPProvider) LoadInputConfig(configs []cfg.ConfigWithFormat, input Input) (map[string]Input, error)
- func (hrp *HTTPProvider) Name() string
- func (hrp *HTTPProvider) StartReloader()
- func (hrp *HTTPProvider) StopReloader()
- type Initializer
- type Input
- type InputOperation
- type Instance
- type InstancesGetter
- type LocalProvider
- func (lp *LocalProvider) GetInputConfig(inputKey string) ([]cfg.ConfigWithFormat, error)
- func (lp *LocalProvider) GetInputs() ([]string, error)
- func (lp *LocalProvider) LoadConfig() (bool, error)
- func (lp *LocalProvider) LoadInputConfig(configs []cfg.ConfigWithFormat, input Input) (map[string]Input, error)
- func (lp *LocalProvider) Name() string
- func (lp *LocalProvider) StartReloader()
- func (lp *LocalProvider) StopReloader()
- type Provider
- type SampleGatherer
Constants ¶
This section is empty.
Variables ¶
View Source
var InputCreators = map[string]Creator{}
Functions ¶
func Collect ¶
func Collect(e prometheus.Collector, slist *types.SampleList, constLabels ...map[string]string) error
func FormatInputName ¶
FormatInputName providerName + '.' + inputKey
func MayGather ¶
func MayGather(t interface{}, slist *types.SampleList)
func ParseInputName ¶
ParseInputName parse name into providerName and inputName
Types ¶
type HTTPProvider ¶
type HTTPProvider struct { sync.RWMutex RemoteUrl string Headers []string AuthUsername string AuthPassword string Timeout int ReloadInterval int tls.ClientConfig // contains filtered or unexported fields }
HTTPProvider provider a mechanism to get config from remote http server at a fixed interval If input config is changed, the provider will reload the input without reload whole agent
func (*HTTPProvider) GetInputConfig ¶
func (hrp *HTTPProvider) GetInputConfig(inputKey string) ([]cfg.ConfigWithFormat, error)
func (*HTTPProvider) GetInputs ¶
func (hrp *HTTPProvider) GetInputs() ([]string, error)
func (*HTTPProvider) LoadConfig ¶
func (hrp *HTTPProvider) LoadConfig() (bool, error)
func (*HTTPProvider) LoadInputConfig ¶
func (hrp *HTTPProvider) LoadInputConfig(configs []cfg.ConfigWithFormat, input Input) (map[string]Input, error)
func (*HTTPProvider) Name ¶
func (hrp *HTTPProvider) Name() string
func (*HTTPProvider) StartReloader ¶
func (hrp *HTTPProvider) StartReloader()
func (*HTTPProvider) StopReloader ¶
func (hrp *HTTPProvider) StopReloader()
type Initializer ¶
type Initializer interface {
Init() error
}
type InputOperation ¶
type InputOperation interface { RegisterInput(string, []cfg.ConfigWithFormat) DeregisterInput(string, string) }
type Instance ¶
type Instance interface { Initialized() bool SetInitialized() GetLabels() map[string]string GetIntervalTimes() int64 InitInternalConfig() error Process(*types.SampleList) *types.SampleList }
func MayGetInstances ¶
func MayGetInstances(t interface{}) []Instance
type InstancesGetter ¶
type InstancesGetter interface {
GetInstances() []Instance
}
type LocalProvider ¶
func (*LocalProvider) GetInputConfig ¶
func (lp *LocalProvider) GetInputConfig(inputKey string) ([]cfg.ConfigWithFormat, error)
func (*LocalProvider) GetInputs ¶
func (lp *LocalProvider) GetInputs() ([]string, error)
func (*LocalProvider) LoadConfig ¶
func (lp *LocalProvider) LoadConfig() (bool, error)
func (*LocalProvider) LoadInputConfig ¶
func (lp *LocalProvider) LoadInputConfig(configs []cfg.ConfigWithFormat, input Input) (map[string]Input, error)
func (*LocalProvider) Name ¶
func (lp *LocalProvider) Name() string
func (*LocalProvider) StartReloader ¶
func (lp *LocalProvider) StartReloader()
StartReloader 内部可以检查是否有配置的变更,如果有变更,则可以手动执行reloadFunc来重启插件
func (*LocalProvider) StopReloader ¶
func (lp *LocalProvider) StopReloader()
type Provider ¶
type Provider interface { // Name 用于给input加前缀使用 Name() string // StartReloader Provider初始化后会调用此方法 // 可以根据需求实现定时加载配置的逻辑 StartReloader() StopReloader() // LoadConfig 加载配置的方法,如果配置改变,返回true;提供给 StartReloader 以及 HUP信号的Reload使用 LoadConfig() (bool, error) // GetInputs 获取当前Provider提供了哪些插件 GetInputs() ([]string, error) // GetInputConfig 获取input的配置,注意处理时先判断配置是否在provider中,如果在provider并且读取错误再返回error GetInputConfig(inputName string) ([]cfg.ConfigWithFormat, error) // 加载 input 的配置 LoadInputConfig([]cfg.ConfigWithFormat, Input) (map[string]Input, error) }
Provider InputProvider的抽象,可以实现此抽象来提供个性化的插件配置能力,如从远端定时读取配置等
func NewProvider ¶
func NewProvider(c *config.ConfigType, op InputOperation) ([]Provider, error)
type SampleGatherer ¶
type SampleGatherer interface {
Gather(*types.SampleList)
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
forked from telegraf https://github.com/influxdata/telegraf/blob/master/plugins/inputs/cloudwatch/sample.conf
|
forked from telegraf https://github.com/influxdata/telegraf/blob/master/plugins/inputs/cloudwatch/sample.conf |
Package docker contains few helper functions copied from https://github.com/docker/cli/blob/master/cli/command/container/stats_helpers.go
|
Package docker contains few helper functions copied from https://github.com/docker/cli/blob/master/cli/command/container/stats_helpers.go |
internal/exporter
Package exporter provides the interface for getting metrics out of mtail, into your monitoring system of choice.
|
Package exporter provides the interface for getting metrics out of mtail, into your monitoring system of choice. |
internal/metrics
Package metrics provides storage for metrics being recorded by mtail programs.
|
Package metrics provides storage for metrics being recorded by mtail programs. |
internal/runtime/code
Package code contains the bytecode instructions for the mtail virtual machine.
|
Package code contains the bytecode instructions for the mtail virtual machine. |
internal/runtime/compiler/opt
package opt has a compiler pass for making optimisations on the AST.
|
package opt has a compiler pass for making optimisations on the AST. |
internal/runtime/compiler/parser
Package parser implements the parse phase of the mtail program compilation.
|
Package parser implements the parse phase of the mtail program compilation. |
internal/runtime/compiler/position
Package position implements a data structure for storing source code positions.
|
Package position implements a data structure for storing source code positions. |
internal/runtime/vm
Package vm provides a virtual machine environment for executing mtail bytecode.
|
Package vm provides a virtual machine environment for executing mtail bytecode. |
internal/tailer
Package tailer provides a class that is responsible for tailing log files and extracting new log lines to be passed into the virtual machines.
|
Package tailer provides a class that is responsible for tailing log files and extracting new log lines to be passed into the virtual machines. |
internal/tailer/logstream
Package logstream provides an interface and implementations of log source streaming.
|
Package logstream provides an interface and implementations of log source streaming. |
internal/testutil
Reimport the go-cmp package as the name 'cmp' conflicts with the cmp instruction in the vm.
|
Reimport the go-cmp package as the name 'cmp' conflicts with the cmp instruction in the vm. |
Click to show internal directories.
Click to hide internal directories.