config

package
v4.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginModeWhitelist = iota
	PluginModeAll
)

Variables

This section is empty.

Functions

func InitPluginsConfig

func InitPluginsConfig(cf *ConfYaml)

func Parse

func Parse(conf string) error

Types

type CollectRuleSection

type CollectRuleSection struct {
	Timeout        int    `yaml:"timeout"`
	Token          string `yaml:"token"`
	UpdateInterval int    `yaml:"updateInterval"`
	IndexInterval  int    `yaml:"indexInterval"`
	ReportInterval int    `yaml:"reportInterval"`
	Mod            string `yaml:"mod"`
}

type ConfYaml

type ConfYaml struct {
	CollectRule     CollectRuleSection   `yaml:"collectRule"`
	Logger          loggeri.Config       `yaml:"logger"`
	Report          report.ReportSection `yaml:"report"`
	WorkerProcesses int                  `yaml:"workerProcesses"`
	PluginsConfig   string               `yaml:"pluginsConfig"`
	HTTP            HTTPSection          `yaml:"http"`
}
var (
	Config *ConfYaml
)

type HTTPSection

type HTTPSection struct {
	Mode         string `yaml:"mode"`
	CookieName   string `yaml:"cookieName"`
	CookieDomain string `yaml:"cookieDomain"`
}

type Metric

type Metric struct {
	Name    string `yaml:"name"`
	Type    string `yaml:"type"`
	Comment string `yaml:"comment"`
	Expr    string `yaml:"expr"`
	// contains filtered or unexported fields
}

func GetMetric

func GetMetric(plugin, metric string, typ telegraf.ValueType) (c *Metric, ok bool)

func (*Metric) Calc

func (p *Metric) Calc(vars map[string][]*dataobj.MetricValue) (float64, error)

type PluginConfig

type PluginConfig struct {
	Name        string
	Mode        int
	Metrics     map[string]*Metric
	ExprMetrics map[string]*Metric
}

func GetPluginConfig

func GetPluginConfig(pluginName string) (c *PluginConfig, ok bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL