telegraf: github.com/influxdata/telegraf Index | Files | Directories

package telegraf

import "github.com/influxdata/telegraf"

Index

Package Files

accumulator.go aggregator.go input.go metric.go output.go plugin.go processor.go

type Accumulator Uses

type Accumulator interface {
    // 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".
    AddFields(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
    AddGauge(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
    AddCounter(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
    AddSummary(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
    AddHistogram(measurement string,
        fields map[string]interface{},
        tags map[string]string,
        t ...time.Time)

    // AddMetric adds an metric to the accumulator.
    AddMetric(Metric)

    // SetPrecision sets the timestamp rounding precision.  All metrics addeds
    // added to the accumulator will have their timestamp rounded to the
    // nearest multiple of precision.
    SetPrecision(precision time.Duration)

    // Report an error.
    AddError(err error)

    // Upgrade to a TrackingAccumulator with space for maxTracked
    // metrics/batches.
    WithTracking(maxTracked int) TrackingAccumulator
}

Accumulator allows adding metrics to the processing flow.

type AggregatingOutput Uses

type AggregatingOutput interface {
    Output

    // Add the metric to the aggregator
    Add(in Metric)
    // Push returns the aggregated metrics and is called every flush interval.
    Push() []Metric
    // Reset signals the the aggregator period is completed.
    Reset()
}

AggregatingOutput adds aggregating functionality to an Output. May be used if the Output only accepts a fixed set of aggregations over a time period. These functions may be called concurrently to the Write function.

type Aggregator Uses

type Aggregator interface {
    PluginDescriber

    // Add the metric to the aggregator.
    Add(in Metric)

    // Push pushes the current aggregates to the accumulator.
    Push(acc Accumulator)

    // Reset resets the aggregators caches and aggregates.
    Reset()
}

Aggregator is an interface for implementing an Aggregator plugin. the RunningAggregator wraps this interface and guarantees that Add, Push, and Reset can not be called concurrently, so locking is not required when implementing an Aggregator plugin.

type DeliveryInfo Uses

type DeliveryInfo interface {
    // ID is the TrackingID
    ID() TrackingID

    // Delivered returns true if the metric was processed successfully.
    Delivered() bool
}

DeliveryInfo provides the results of a delivered metric group.

type Field Uses

type Field struct {
    Key   string
    Value interface{}
}

Field represents a single field key and value.

type Initializer Uses

type Initializer interface {
    // Init performs one time setup of the plugin and returns an error if the
    // configuration is invalid.
    Init() error
}

Initializer is an interface that all plugin types: Inputs, Outputs, Processors, and Aggregators can optionally implement to initialize the plugin.

type Input Uses

type Input interface {
    PluginDescriber

    // Gather takes in an accumulator and adds the metrics that the Input
    // gathers. This is called every "interval"
    Gather(Accumulator) error
}

type Logger Uses

type Logger interface {
    // Errorf logs an error message, patterned after log.Printf.
    Errorf(format string, args ...interface{})
    // Error logs an error message, patterned after log.Print.
    Error(args ...interface{})
    // Debugf logs a debug message, patterned after log.Printf.
    Debugf(format string, args ...interface{})
    // Debug logs a debug message, patterned after log.Print.
    Debug(args ...interface{})
    // Warnf logs a warning message, patterned after log.Printf.
    Warnf(format string, args ...interface{})
    // Warn logs a warning message, patterned after log.Print.
    Warn(args ...interface{})
    // Infof logs an information message, patterned after log.Printf.
    Infof(format string, args ...interface{})
    // Info logs an information message, patterned after log.Print.
    Info(args ...interface{})
}

Logger defines an interface for logging.

type Metric Uses

type Metric interface {
    // Name is the primary identifier for the Metric and corresponds to the
    // measurement in the InfluxDB data model.
    Name() string

    // Tags returns the tags as a map.  This method is deprecated, use TagList instead.
    Tags() map[string]string

    // TagList returns the tags as a slice ordered by the tag key in lexical
    // bytewise ascending order.  The returned value should not be modified,
    // use the AddTag or RemoveTag methods instead.
    TagList() []*Tag

    // Fields returns the fields as a map.  This method is deprecated, use FieldList instead.
    Fields() map[string]interface{}

    // FieldList returns the fields as a slice in an undefined order.  The
    // returned value should not be modified, use the AddField or RemoveField
    // methods instead.
    FieldList() []*Field

    // Time returns the timestamp of the metric.
    Time() time.Time

    // Type returns a general type for the entire metric that describes how you
    // might interpret, aggregate the values.
    //
    // This method may be removed in the future and its use is discouraged.
    Type() ValueType

    // SetName sets the metric name.
    SetName(name string)

    // AddPrefix adds a string to the front of the metric name.  It is
    // equivalent to m.SetName(prefix + m.Name()).
    //
    // This method is deprecated, use SetName instead.
    AddPrefix(prefix string)

    // AddSuffix appends a string to the back of the metric name.  It is
    // equivalent to m.SetName(m.Name() + suffix).
    //
    // This method is deprecated, use SetName instead.
    AddSuffix(suffix string)

    // GetTag returns the value of a tag and a boolean to indicate if it was set.
    GetTag(key string) (string, bool)

    // HasTag returns true if the tag is set on the Metric.
    HasTag(key string) bool

    // AddTag sets the tag on the Metric.  If the Metric already has the tag
    // set then the current value is replaced.
    AddTag(key, value string)

    // RemoveTag removes the tag if it is set.
    RemoveTag(key string)

    // GetField returns the value of a field and a boolean to indicate if it was set.
    GetField(key string) (interface{}, bool)

    // HasField returns true if the field is set on the Metric.
    HasField(key string) bool

    // AddField sets the field on the Metric.  If the Metric already has the field
    // set then the current value is replaced.
    AddField(key string, value interface{})

    // RemoveField removes the tag if it is set.
    RemoveField(key string)

    // SetTime sets the timestamp of the Metric.
    SetTime(t time.Time)

    // HashID returns an unique identifier for the series.
    HashID() uint64

    // Copy returns a deep copy of the Metric.
    Copy() Metric

    // Accept marks the metric as processed successfully and written to an
    // output.
    Accept()

    // Reject marks the metric as processed unsuccessfully.
    Reject()

    // Drop marks the metric as processed successfully without being written
    // to any output.
    Drop()

    // SetAggregate indicates the metric is an aggregated value.
    //
    // This method may be removed in the future and its use is discouraged.
    SetAggregate(bool)

    // IsAggregate returns true if the Metric is an aggregate.
    //
    // This method may be removed in the future and its use is discouraged.
    IsAggregate() bool
}

Metric is the type of data that is processed by Telegraf. Input plugins, and to a lesser degree, Processor and Aggregator plugins create new Metrics and Output plugins write them.

type Output Uses

type Output interface {
    PluginDescriber

    // Connect to the Output
    Connect() error
    // Close any connections to the Output
    Close() error
    // Write takes in group of points to be written to the Output
    Write(metrics []Metric) error
}

type PluginDescriber Uses

type PluginDescriber interface {
    // SampleConfig returns the default configuration of the Processor
    SampleConfig() string

    // Description returns a one-sentence description on the Processor
    Description() string
}

PluginDescriber contains the functions all plugins must implement to describe themselves to Telegraf

type Processor Uses

type Processor interface {
    PluginDescriber

    // Apply the filter to the given metric.
    Apply(in ...Metric) []Metric
}

Processor is a processor plugin interface for defining new inline processors. these are extremely efficient and should be used over StreamingProcessor if you do not need asynchronous metric writes.

type ServiceInput Uses

type ServiceInput interface {
    Input

    // Start the ServiceInput.  The Accumulator may be retained and used until
    // Stop returns.
    Start(Accumulator) error

    // Stop stops the services and closes any necessary channels and connections
    Stop()
}

type StreamingProcessor Uses

type StreamingProcessor interface {
    PluginDescriber

    // Start is the initializer for the processor
    // Start is only called once per plugin instance, and never in parallel.
    // Start should exit immediately after setup
    Start(acc Accumulator) error

    // Add is called for each metric to be processed.
    Add(metric Metric, acc Accumulator) error

    // Stop gives you a callback to free resources.
    // by the time Stop is called, the input stream will have already been closed
    // and Add will not be called anymore.
    // When stop returns, you should no longer be writing metrics to the
    // accumulator.
    Stop() error
}

StreamingProcessor is a processor that can take in a stream of messages

type Tag Uses

type Tag struct {
    Key   string
    Value string
}

Tag represents a single tag key and value.

type TrackingAccumulator Uses

type TrackingAccumulator interface {
    Accumulator

    // Add the Metric and arrange for tracking feedback after processing..
    AddTrackingMetric(m Metric) TrackingID

    // Add a group of Metrics and arrange for a signal when the group has been
    // processed.
    AddTrackingMetricGroup(group []Metric) TrackingID

    // Delivered returns a channel that will contain the tracking results.
    Delivered() <-chan DeliveryInfo
}

TrackingAccumulator is an Accumulator that provides a signal when the metric has been fully processed. Sending more metrics than the accumulator has been allocated for without reading status from the Accepted or Rejected channels is an error.

type TrackingID Uses

type TrackingID uint64

TrackingID uniquely identifies a tracked metric group

type ValueType Uses

type ValueType int

ValueType is an enumeration of metric types that represent a simple value.

const (
    Counter ValueType
    Gauge
    Untyped
    Summary
    Histogram
)

Possible values for the ValueType enum.

Directories

PathSynopsis
agent
config
config/aws
filter
internal
internal/choicePackage choice provides basic functions for working with plugin options that must be one of several values.
internal/docker
internal/globpath
internal/goplugin
internal/limiter
internal/process
internal/rotate
internal/snmp
internal/syslog
internal/templating
logger
metric
models
plugins/aggregators
plugins/aggregators/all
plugins/aggregators/basicstats
plugins/aggregators/final
plugins/aggregators/histogram
plugins/aggregators/merge
plugins/aggregators/minmax
plugins/aggregators/valuecounter
plugins/common/encoding
plugins/common/kafka
plugins/common/logrus
plugins/common/shim
plugins/common/tls
plugins/inputs
plugins/inputs/activemq
plugins/inputs/aerospike
plugins/inputs/all
plugins/inputs/amqp_consumer
plugins/inputs/apache
plugins/inputs/apcupsd
plugins/inputs/aurora
plugins/inputs/azure_storage_queue
plugins/inputs/bcache
plugins/inputs/beanstalkd
plugins/inputs/bind
plugins/inputs/bond
plugins/inputs/burrow
plugins/inputs/cassandra
plugins/inputs/ceph
plugins/inputs/cgroup
plugins/inputs/chrony
plugins/inputs/cisco_telemetry_mdt
plugins/inputs/clickhouse
plugins/inputs/cloud_pubsub
plugins/inputs/cloud_pubsub_push
plugins/inputs/cloudwatch
plugins/inputs/conntrack
plugins/inputs/consul
plugins/inputs/couchbase
plugins/inputs/couchdb
plugins/inputs/cpu
plugins/inputs/dcos
plugins/inputs/disk
plugins/inputs/diskio
plugins/inputs/disque
plugins/inputs/dmcache
plugins/inputs/dns_query
plugins/inputs/dockerHelper functions copied from https://github.com/docker/cli/blob/master/cli/command/container/stats_helpers.go
plugins/inputs/docker_log
plugins/inputs/dovecot
plugins/inputs/ecs
plugins/inputs/elasticsearch
plugins/inputs/ethtool
plugins/inputs/eventhub_consumer
plugins/inputs/exec
plugins/inputs/execd
plugins/inputs/execd/examples
plugins/inputs/execd/shim
plugins/inputs/fail2ban
plugins/inputs/fibaro
plugins/inputs/file
plugins/inputs/filecount
plugins/inputs/filestat
plugins/inputs/fireboard
plugins/inputs/fluentd
plugins/inputs/github
plugins/inputs/gnmi
plugins/inputs/graylog
plugins/inputs/haproxy
plugins/inputs/hddtemp
plugins/inputs/hddtemp/go-hddtemp
plugins/inputs/http
plugins/inputs/httpjson
plugins/inputs/http_listener_v2
plugins/inputs/http_response
plugins/inputs/icinga2
plugins/inputs/infiniband
plugins/inputs/influxdb
plugins/inputs/influxdb_listener
plugins/inputs/internal
plugins/inputs/interrupts
plugins/inputs/ipmi_sensor
plugins/inputs/ipset
plugins/inputs/iptables
plugins/inputs/ipvs
plugins/inputs/jenkins
plugins/inputs/jolokia
plugins/inputs/jolokia2
plugins/inputs/jti_openconfig_telemetry
plugins/inputs/jti_openconfig_telemetry/authPackage authentication is a generated protocol buffer package.
plugins/inputs/jti_openconfig_telemetry/ocPackage telemetry is a generated protocol buffer package.
plugins/inputs/kafka_consumer
plugins/inputs/kafka_consumer_legacy
plugins/inputs/kapacitor
plugins/inputs/kernel
plugins/inputs/kernel_vmstat
plugins/inputs/kibana
plugins/inputs/kinesis_consumer
plugins/inputs/kube_inventory
plugins/inputs/kubernetes
plugins/inputs/lanz
plugins/inputs/leofs
plugins/inputs/linux_sysctl_fs
plugins/inputs/logparser
plugins/inputs/logstash
plugins/inputs/lustre2Lustre 2.x telegraf plugin
plugins/inputs/mailchimp
plugins/inputs/marklogic
plugins/inputs/mcrouter
plugins/inputs/mem
plugins/inputs/memcached
plugins/inputs/mesos
plugins/inputs/minecraft
plugins/inputs/minecraft/internal/rconPackage rcon implements the communication protocol for communicating with RCON servers.
plugins/inputs/modbus
plugins/inputs/mongodb
plugins/inputs/monit
plugins/inputs/mqtt_consumer
plugins/inputs/multifile
plugins/inputs/mysql
plugins/inputs/mysql/v1
plugins/inputs/mysql/v2
plugins/inputs/nats
plugins/inputs/nats_consumer
plugins/inputs/neptune_apexPackage neptuneapex implements an input plugin for the Neptune Apex aquarium controller.
plugins/inputs/net
plugins/inputs/net_response
plugins/inputs/nginx
plugins/inputs/nginx_plus
plugins/inputs/nginx_plus_api
plugins/inputs/nginx_sts
plugins/inputs/nginx_upstream_check
plugins/inputs/nginx_vts
plugins/inputs/nsq
plugins/inputs/nsq_consumer
plugins/inputs/nstat
plugins/inputs/ntpq
plugins/inputs/nvidia_smi
plugins/inputs/openldap
plugins/inputs/openntpd
plugins/inputs/opensmtpd
plugins/inputs/openweathermap
plugins/inputs/passenger
plugins/inputs/pf
plugins/inputs/pgbouncer
plugins/inputs/phpfpmPackage fcgi implements the FastCGI protocol.
plugins/inputs/ping
plugins/inputs/postfix
plugins/inputs/postgresql
plugins/inputs/postgresql_extensible
plugins/inputs/powerdns
plugins/inputs/powerdns_recursor
plugins/inputs/processes
plugins/inputs/procstat
plugins/inputs/prometheus
plugins/inputs/puppetagent
plugins/inputs/rabbitmq
plugins/inputs/raindrops
plugins/inputs/redfish
plugins/inputs/redis
plugins/inputs/rethinkdb
plugins/inputs/riak
plugins/inputs/salesforce
plugins/inputs/sensors
plugins/inputs/sflow
plugins/inputs/sflow/binaryio
plugins/inputs/smart
plugins/inputs/snmp
plugins/inputs/snmp_legacy
plugins/inputs/snmp_trap
plugins/inputs/socket_listener
plugins/inputs/solr
plugins/inputs/sqlserver
plugins/inputs/stackdriver
plugins/inputs/statsd
plugins/inputs/suricata
plugins/inputs/swap
plugins/inputs/synproxy
plugins/inputs/syslog
plugins/inputs/sysstat
plugins/inputs/system
plugins/inputs/systemd_units
plugins/inputs/tail
plugins/inputs/tcp_listener
plugins/inputs/teamspeak
plugins/inputs/temp
plugins/inputs/tengine
plugins/inputs/tomcat
plugins/inputs/trig
plugins/inputs/twemproxy
plugins/inputs/udp_listener
plugins/inputs/unbound
plugins/inputs/uwsgiPackage uwsgi implements a telegraf plugin for collecting uwsgi stats from the uwsgi stats server.
plugins/inputs/varnish
plugins/inputs/vsphere
plugins/inputs/webhooks
plugins/inputs/webhooks/filestack
plugins/inputs/webhooks/github
plugins/inputs/webhooks/mandrill
plugins/inputs/webhooks/papertrail
plugins/inputs/webhooks/particle
plugins/inputs/webhooks/rollbar
plugins/inputs/win_perf_counters
plugins/inputs/win_services
plugins/inputs/wireguard
plugins/inputs/wireless
plugins/inputs/x509_certPackage x509_cert reports metrics from an SSL certificate.
plugins/inputs/zfs
plugins/inputs/zipkin
plugins/inputs/zipkin/codec
plugins/inputs/zipkin/codec/jsonV1
plugins/inputs/zipkin/codec/thrift
plugins/inputs/zipkin/trace
plugins/inputs/zookeeper
plugins/outputs
plugins/outputs/all
plugins/outputs/amon
plugins/outputs/amqp
plugins/outputs/application_insights
plugins/outputs/application_insights/mocksCode generated by mockery v1.0.0
plugins/outputs/azure_monitor
plugins/outputs/cloud_pubsub
plugins/outputs/cloudwatch
plugins/outputs/cratedb
plugins/outputs/datadog
plugins/outputs/discard
plugins/outputs/elasticsearch
plugins/outputs/exec
plugins/outputs/execd
plugins/outputs/file
plugins/outputs/graphite
plugins/outputs/graylog
plugins/outputs/health
plugins/outputs/http
plugins/outputs/influxdb
plugins/outputs/influxdb_v2
plugins/outputs/instrumental
plugins/outputs/kafka
plugins/outputs/kinesis
plugins/outputs/librato
plugins/outputs/mqtt
plugins/outputs/nats
plugins/outputs/newrelic
plugins/outputs/nsq
plugins/outputs/opentsdb
plugins/outputs/prometheus_client
plugins/outputs/prometheus_client/v1
plugins/outputs/prometheus_client/v2
plugins/outputs/riemann
plugins/outputs/riemann_legacy
plugins/outputs/socket_writer
plugins/outputs/stackdriver
plugins/outputs/syslog
plugins/outputs/warp10
plugins/outputs/wavefront
plugins/parsers
plugins/parsers/collectd
plugins/parsers/csv
plugins/parsers/dropwizard
plugins/parsers/form_urlencoded
plugins/parsers/graphite
plugins/parsers/grok
plugins/parsers/influx
plugins/parsers/json
plugins/parsers/logfmt
plugins/parsers/nagios
plugins/parsers/value
plugins/parsers/wavefront
plugins/processors
plugins/processors/all
plugins/processors/clone
plugins/processors/converter
plugins/processors/date
plugins/processors/dedup
plugins/processors/defaults
plugins/processors/enum
plugins/processors/execd
plugins/processors/filepath
plugins/processors/ifname
plugins/processors/override
plugins/processors/parser
plugins/processors/pivot
plugins/processors/port_name
plugins/processors/printer
plugins/processors/regex
plugins/processors/rename
plugins/processors/reverse_dns
plugins/processors/reverse_dns/parallel
plugins/processors/s2geo
plugins/processors/starlark
plugins/processors/strings
plugins/processors/tag_limit
plugins/processors/template
plugins/processors/topk
plugins/processors/unpivot
plugins/serializers
plugins/serializers/carbon2
plugins/serializers/graphite
plugins/serializers/influx
plugins/serializers/json
plugins/serializers/nowmetric
plugins/serializers/prometheus
plugins/serializers/splunkmetric
plugins/serializers/wavefront
selfstatselfstat is a package for tracking and collecting internal statistics about telegraf.
testutil

Package telegraf imports 1 packages (graph) and is imported by 4668 packages. Updated 2020-08-08. Refresh now. Tools for package owners.