Telegraf Aggregator Plugins
Telegraf aggregator plugins aggregate data across multiple metrics. Aggregator plugins create aggregate metrics–for example, by implementing statistical functions such as mean, min, and max.
Basic Statistics
This plugin computes basic statistics such as counts, differences,
minima, maxima, mean values, non-negative differences etc. for a set of
metrics and emits these statistical values every period
.
Derivative
This plugin computes the derivative for all fields of the aggregated metrics.
Final
This plugin emits the last metric of a contiguous series, defined as a
series which receives updates within the time period in series_timeout
.
The contiguous series may be longer than the time interval defined by
period
. When a series has not been updated within the series_timeout
,
the last metric is emitted.
Alternatively, the plugin emits the last metric in the period
for the
periodic
output strategy.
This is useful for getting the final value for data sources that produce discrete time series such as procstat, cgroup, kubernetes etc. or to downsample metrics collected at a higher frequency.
All emited metrics do have fields with _final
appended to the
field-name by default.
Histogram
This plugin creates histograms containing the counts of field values
within the configured range. The histogram metric is emitted every
period
.
In cumulative
mode, values added to a bucket are also added to the
consecutive buckets in the distribution creating a cumulative
histogram.
By default bucket counts are not reset between periods and will be
non-strictly increasing while Telegraf is running. This behavior can be
by setting the reset
parameter.
Merge
This plugin merges metrics of the same series and timestamp into new metrics with the super-set of fields. A series here is defined by the metric name and the tag key-value set.
Use this plugin when fields are split over multiple metrics, with the same measurement, tag set and timestamp.
Minimum-Maximum
This plugin aggregates the minimum and maximum values of each field it
sees, emitting the aggrate every period
seconds with field names
suffixed by _min
and _max
respectively.
Quantile
This plugin aggregates each numeric field per metric into the specified
quantiles and emits the quantiles every period
. Different aggregation
algorithms are supported with varying accuracy and limitations.
Starlark
This plugin allows to implement a custom aggregator plugin via a Starlark script.
The Starlark language is a dialect of Python and will be familiar to those who have experience with the Python language. However, there are major differences. Existing Python code is unlikely to work unmodified.
The execution environment is sandboxed, and it is not possible to access the local filesystem or perfoming network operations. This is by design of the Starlark language as a configuration language.
The Starlark script used by this plugin needs to be composed of the three
methods defining an aggreagtor named add
, push
and reset
.
The add
method is called as soon as a new metric is added to the plugin
the metrics to the aggregator. After period
, the push
method is
called to output the resulting metrics and finally the aggregation is
reset by using the reset
method of the Starlark script.
The Starlark functions might use the global function state
to keep
aggregation information such as added metrics etc.
More details on the syntax and available functions can be found in the Starlark specification.
Value Counter
This plugin counts the occurrence of unique values in fields and emits
the counter once every period
with the field-names being suffixed by
the unique value converted to string
.
The fields to be counted must be configured using the fields
setting,
otherwise no field will be counted and no metric is emitted.
This plugin is useful to e.g. count the occurrances of HTTP status codes
or other categorical values in the defined period
.
Counting fields with a high number of potential values may produce a significant amounts of new fields and results in an increased memory usage. Take care to only count fields with a limited set of values.
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Telegraf and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.