inputs

package
v0.0.0-...-48273b5 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedType = errors.New("input does not have the expected type")
	ErrDisabledInput  = errors.New("input is not enabled in service Telegraf")
	ErrMissingCommand = errors.New("missing command for input")
)

Functions

func CheckLockedMemory

func CheckLockedMemory()

func ConvertToFloat

func ConvertToFloat(value interface{}) (float64, error)

ConvertToFloat convert the interface type in float64.

func MaxParallelSecrets

func MaxParallelSecrets() int

Types

type Accumulator

type Accumulator struct {
	Pusher  types.PointPusher
	Context context.Context //nolint:containedctx
	// contains filtered or unexported fields
}

Accumulator implement telegraf.Accumulator (+AddFieldsWithAnnotations) and emit the metric points. Gathering errors can be added and retrieved concurrently, using AddError() and Errors().

func (*Accumulator) AddCounter

func (a *Accumulator) AddCounter(measurement string, fields map[string]interface{}, tags map[string]string, t ...time.Time)

AddCounter is the same as AddFields, but will add the metric as a "Counter" type.

func (*Accumulator) AddError

func (a *Accumulator) AddError(err error)

AddError add an error to the Accumulator.

func (*Accumulator) AddFields

func (a *Accumulator) AddFields(measurement string, fields map[string]interface{}, tags map[string]string, t ...time.Time)

AddFields adds a metric to the accumulator with the given measurement name, fields, and tags (and timestamp). If a timestamp is not provided, then the accumulator sets it to "now". Create a point with a value, decorating it with tags NOTE: tags is expected to be owned by the caller, don't mutate it after passing to Add.

func (*Accumulator) AddFieldsWithAnnotations

func (a *Accumulator) AddFieldsWithAnnotations(measurement string, fields map[string]interface{}, tags map[string]string, annotations types.MetricAnnotations, t ...time.Time)

AddFieldsWithAnnotations have extra fields for the annotations attached to the measurement and fields

Note the annotation are not attached to the measurement, but to the resulting labels set. Resulting labels set are all tags + the metric name which is measurement concatenated with field name.

This also means that if the same measurement (e.g. "cpu") need different annotations (e.g. a status for field "used" but none for field "system"), you must to multiple call to AddFieldsWithAnnotations

If a status is set in the annotation, not threshold will be applied on the metrics.

func (*Accumulator) AddGauge

func (a *Accumulator) AddGauge(measurement string, fields map[string]interface{}, tags map[string]string, t ...time.Time)

AddGauge is the same as AddFields, but will add the metric as a "Gauge" type.

func (*Accumulator) AddHistogram

func (a *Accumulator) AddHistogram(measurement string, fields map[string]interface{}, tags map[string]string, t ...time.Time)

AddHistogram is the same as AddFields, but will add the metric as a "Histogram" type.

func (*Accumulator) AddMetric

func (a *Accumulator) AddMetric(telegraf.Metric)

AddMetric is not yet implemented.

func (*Accumulator) AddSummary

func (a *Accumulator) AddSummary(measurement string, fields map[string]interface{}, tags map[string]string, t ...time.Time)

AddSummary is the same as AddFields, but will add the metric as a "Summary" type.

func (*Accumulator) Errors

func (a *Accumulator) Errors() []error

func (*Accumulator) SetPrecision

func (a *Accumulator) SetPrecision(time.Duration)

SetPrecision do nothing right now.

func (*Accumulator) WithTracking

func (a *Accumulator) WithTracking(maxTracked int) telegraf.TrackingAccumulator

WithTracking is not yet implemented.

type AnnotationAccumulator

type AnnotationAccumulator interface {
	AddFieldsWithAnnotations(measurement string, fields map[string]interface{}, tags map[string]string, annotations types.MetricAnnotations, t ...time.Time)
	AddError(err error)
}

AnnotationAccumulator is a similar to an telegraf.Accumulator but allow to send metric with annocations.

type CollectorConfig

type CollectorConfig struct {
	DFRootPath      string
	DFPathMatcher   types.Matcher
	DFIgnoreFSTypes []string
	NetIfMatcher    types.MatcherRegexp
	IODiskMatcher   types.MatcherRegexp
}

CollectorConfig represents the configuration of a collector.

type ErrorAccumulator

type ErrorAccumulator interface {
	Errors() []error
}

type FixedTimeAccumulator

type FixedTimeAccumulator struct {
	Time time.Time
	Acc  telegraf.Accumulator
}

FixedTimeAccumulator implement telegraf.Accumulator (+AddFieldsWithAnnotations) and use given Time for all points.

func (FixedTimeAccumulator) AddCounter

func (a FixedTimeAccumulator) AddCounter(measurement string, fields map[string]interface{}, tags map[string]string, _ ...time.Time)

AddCounter is the same as AddFields, but will add the metric as a "Counter" type.

func (FixedTimeAccumulator) AddError

func (a FixedTimeAccumulator) AddError(err error)

AddError add an error to the Accumulator.

func (FixedTimeAccumulator) AddFields

func (a FixedTimeAccumulator) AddFields(measurement string, fields map[string]interface{}, tags map[string]string, _ ...time.Time)

AddFields adds a metric to the accumulator with the given measurement name, fields, and tags (and timestamp). If a timestamp is not provided, then the accumulator sets it to "now". Create a point with a value, decorating it with tags NOTE: tags is expected to be owned by the caller, don't mutate it after passing to Add.

func (FixedTimeAccumulator) AddFieldsWithAnnotations

func (a FixedTimeAccumulator) AddFieldsWithAnnotations(measurement string, fields map[string]interface{}, tags map[string]string, annotations types.MetricAnnotations, _ ...time.Time)

AddFieldsWithAnnotations have extra fields for the annotations attached to the measurement and fields

This method call AddFieldsWithAnnotations() is available and call AddGauge + AddError otherwise.

func (FixedTimeAccumulator) AddGauge

func (a FixedTimeAccumulator) AddGauge(measurement string, fields map[string]interface{}, tags map[string]string, _ ...time.Time)

AddGauge is the same as AddFields, but will add the metric as a "Gauge" type.

func (FixedTimeAccumulator) AddHistogram

func (a FixedTimeAccumulator) AddHistogram(measurement string, fields map[string]interface{}, tags map[string]string, _ ...time.Time)

AddHistogram is the same as AddFields, but will add the metric as a "Histogram" type.

func (FixedTimeAccumulator) AddMetric

func (a FixedTimeAccumulator) AddMetric(telegraf.Metric)

AddMetric is not yet implemented.

func (FixedTimeAccumulator) AddSummary

func (a FixedTimeAccumulator) AddSummary(measurement string, fields map[string]interface{}, tags map[string]string, _ ...time.Time)

AddSummary is the same as AddFields, but will add the metric as a "Summary" type.

func (FixedTimeAccumulator) SetPrecision

func (a FixedTimeAccumulator) SetPrecision(time.Duration)

SetPrecision do nothing right now.

func (FixedTimeAccumulator) WithTracking

func (a FixedTimeAccumulator) WithTracking(maxTracked int) telegraf.TrackingAccumulator

WithTracking is not yet implemented.

type SecretfulInput

type SecretfulInput interface {
	SecretCount() int
}

SecretfulInput represents an input that potentially contains secrets.

Jump to

Keyboard shortcuts

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