telegrafreceiver

package module
v0.0.50-beta.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0, MIT Imports: 15 Imported by: 0

README

Telegraf Receiver

Telegraf receiver for ingesting metrics from various input plugins into otc pipeline.

Supported pipeline types: metrics

Use case: user configures telegraf input plugins in config for ingestion and otc processors and exporters for data processing and export.

🚧 This receiver is currently in BETA and is considered unstable.

Configuration

The following settings are required:

  • agent_config: Telegraf config. For now it allows to provide agent and input plugins configuration. One can refer to telegraf configuration docs for full list of configuration options.

The Following settings are optional:

  • separate_field (default value is false): Specify whether metric field should be added separately as data point label.

Example:

receivers:
  telegraf:
    separate_field: false
    agent_config: |
      [agent]
        interval = "2s"
        flush_interval = "3s"
      [[inputs.mem]]

The full list of settings exposed for this receiver are documented in config.go.

Limitations

With its current implementation Telegraf receiver has the following limitations:

  • only input plugins can be configured in telegraf agent confugration section (apart from agent's configuration itself). That means that metrics go straight from input plugin to the receiver for translation (into otc data model) without any processing
  • ony telegraf.Gauge metric data is supported, which translated (loosly) into pdata.MetricDataTypeDoubleGauge and pdata.MetricDataTypeIntGauge depending on the underlying data type

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyStarted = errors.New("component already started")
	ErrAlreadyStopped = errors.New("component already stopped")
)

Functions

func NewFactory

func NewFactory() component.ReceiverFactory

NewFactory creates a factory for telegraf receiver.

Types

type AttributeMapOpt

type AttributeMapOpt func(attributeMap pdata.AttributeMap)

type Config

type Config struct {
	*config.ReceiverSettings `mapstructure:"-"`

	// AgentConfig is the yaml config used as telegraf configuration.
	// Please note that only inputs should be configured as all metrics gathered
	// by them will be passed through to otc pipeline for processing and export.
	AgentConfig string `mapstructure:"agent_config"`

	// SeparateField controls whether the ingested metrics should have a field
	// concatenated with metric name like e.g. metric=mem_available or maybe rather
	// have it as a separate label like e.g. metric=mem field=available
	SeparateField bool `mapstructure:"separate_field"`
}

Config defines configuration for the telegraf receiver.

type MetricConverter

type MetricConverter interface {
	Convert(telegraf.Metric) (pdata.Metrics, error)
}

type MetricOpt

type MetricOpt func(m pdata.Metric)

MetricOpt is an option func that takes in a pdata.Metric and manipulates it.

func WithField

func WithField(field string) MetricOpt

WithField returns a MetricOpt which will set the returned metric's field tag to the specified one.

func WithName

func WithName(name string) MetricOpt

WithName returns a MetricOpt which will set the returned metric name.

func WithTag

func WithTag(tag *telegraf.Tag) MetricOpt

WithTag returns a MetricOpt which will insert a specified telegraf tag into all underlying data points' label maps.

func WithTags

func WithTags(tags []*telegraf.Tag) MetricOpt

WithTags returns a MetricOpt which will insert a list of telegraf tags into all underlying data points' label maps.

func WithTime

func WithTime(t time.Time) MetricOpt

WithTime returns a MetricOpt which will set the returned metric's timestamp.

type TimeOpt

type TimeOpt func() time.Time

Jump to

Keyboard shortcuts

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