adapter

package
v1.3000030.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 13 Imported by: 0

README

Adapter Receiver

The Adapter Receiver receives Telegraf metrics, filters unsupported value and converts them to corresponding OTEL metrics before passing down to OTEL processors and exporters. This is intended to be used when Telegraf input plugins are still intact.

Status
Stability [stable]
Supported pipeline types metrics
Distributions [amazon-cloudwatch-agent]

Architectural

Data Conversion

Convert Telegraf Metrics with the following type (Counter, Gauge, or Untyped)

Metric {
    Name
    TagList (each tag with key, value)
    FieldList (each field with key, value) 
    Time
    Type (Counter, Gauge, Summary, Histogram, or Untyped)
}

to OpenTelemetry Int64DataPoints, DoubleDataPoints metrics datapoints

Metrics {
    ResourceMetrics: list of {
      Resource: {
        Attributes: map of {key: value}
      }
      InstrumentationScopeMetrics: list of {
        InstrumentationLibrary: {Name, Version}
        Metrics: list of {
          Name
          Description
          Unit
          DataType (None, Gauge, Sum, Histogram, Summary)
          depending on DataType, e.g. Gauge: {
            DataPoints: list of {
              Attributes: map of {key: value}
              Timestamp
              Type (None, Int, Double)
              Val
            }
          }
        }
      }
    }
  }

Receiver Configuration

The following receiver configuration parameters are supported.

Name Description Default
collection_interval is the option to set the collection interval for each plugin "1m"
alias_name is the option to set the different name for each plugin. ""

Documentation

Index

Constants

View Source
const (
	TelegrafPrefix = "telegraf_"
)

Variables

This section is empty.

Functions

func Type

func Type(input string) component.Type

Type joins the TelegrafPrefix to the input.

Types

type AdaptedReceiver

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

AdaptedReceiver uses an OTel Scrape Controller to scrape metrics and has three phases: Start: Start the accumulator to initialize the logger and resources metrics Scrape: Gather metrics using the accumulator (e.g CPU https://github.com/influxdata/telegraf/blob/6e924fcd5cc2ce79a024b7275d865d7a19c455ed/plugins/inputs/cpu/cpu.go) Shutdown: Stop the scraper and flush the remaining metrics before shutting down the scraper

type Adapter

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

func NewAdapter

func NewAdapter(telegrafConfig *telegrafconfig.Config) Adapter

func (Adapter) NewReceiverFactory

func (a Adapter) NewReceiverFactory(telegrafInputName string) receiver.Factory

type Config

type Config struct {
	scraperhelper.ScraperControllerSettings `mapstructure:",squash"`

	// The different name of the plugin, share the similar structure with https://github.com/influxdata/telegraf/pull/6207
	AliasName string `mapstructure:"alias_name,omitempty"`
}

func (*Config) Validate

func (cfg *Config) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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