Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Example ¶
type Example struct { // Example for a mandatory option to set a tag DeviceName string `toml:"device_name"` // Config options are converted to the correct type automatically NumberFields int64 `toml:"number_fields"` // We can also use booleans and have diverging names between user-configuration options and struct members EnableRandomVariable bool `toml:"enable_random"` // Example of passing a duration option allowing the format of e.g. "100ms", "5m" or "1h" Timeout config.Duration `toml:"timeout"` // Telegraf logging facility // The exact name is important to allow automatic initialization by telegraf. Log telegraf.Logger `toml:"-"` // contains filtered or unexported fields }
Example struct should be named the same as the Plugin
func (*Example) Description ¶
Description will appear directly above the plugin definition in the config file
func (*Example) Gather ¶
func (m *Example) Gather(acc telegraf.Accumulator) error
Gather defines what data the plugin will gather.
func (*Example) Init ¶
Init can be implemented to do one-time processing stuff like initializing variables
func (*Example) SampleConfig ¶
SampleConfig will populate the sample configuration portion of the plugin's configuration
Click to show internal directories.
Click to hide internal directories.