collector

package
v0.0.0-...-16be10e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package collector does the metric point gathering for all configured input every fixed time interval

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector implement running Gather on inputs every fixed time interval.

func New

func New(acc telegraf.Accumulator, secretInputsGate *gate.Gate) *Collector

New returns a Collector with default option

By default, no input are added (use AddInput) and collection is done every 10 seconds.

func (*Collector) AddInput

func (c *Collector) AddInput(input telegraf.Input, shortName string) (int, error)

AddInput add an input to this collector and return an ID.

func (*Collector) Close

func (c *Collector) Close()

Close stops all inputs.

func (*Collector) RemoveInput

func (c *Collector) RemoveInput(id int)

RemoveInput removes an input by its ID.

func (*Collector) RunGather

func (c *Collector) RunGather(ctx context.Context, t0 time.Time) error

RunGather run one gather and send metric through the accumulator.

Jump to

Keyboard shortcuts

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