文档文档

最终聚合器插件

此插件发出连续序列的最后一个指标,该序列定义为在 series_timeout 的时间周期内接收更新的序列。连续序列可以比 period 定义的时间间隔长。当一个序列在 series_timeout 内未收到更新时,将发出最后一个指标。

或者,插件会为 periodic 输出策略发出 period 内的最后一个指标。

这对于获取生产离散时间序列(如 procstat、cgroup、kubernetes 等)的数据源的最终值,或对以更高频率收集的指标进行降采样非常有用。

所有发出的指标的字段名称默认都带有 _final 后缀。

引入于: Telegraf v1.11.0 标签: sampling 操作系统支持: all

全局配置选项

插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md

配置

# Report the final metric of a series
[[aggregators.final]]
  ## The period on which to flush & clear the aggregator.
  # period = "30s"

  ## If true, the original metric will be dropped by the
  ## aggregator and will not get sent to the output plugins.
  # drop_original = false

  ## If false, _final is added to every field name
  # keep_original_field_names = false

  ## The time that a series is not updated until considering it final. Ignored
  ## when output_strategy is "periodic".
  # series_timeout = "5m"

  ## Output strategy, supported values:
  ##   timeout  -- output a metric if no new input arrived for `series_timeout`
  ##   periodic -- output the last received metric every `period`
  # output_strategy = "timeout"

输出策略

默认情况下 (output_strategy = "timeout"),只有当最后一个接收到的指标比 series_timeout 更旧时,插件才会为该周期发出一个指标。这不能保证 final 指标的规律性输出,例如,如果 series-timeout 是输入收集间隔的倍数。在这种情况下,指标会零星地进入周期的超时阶段,并且 final 指标的发出会被抑制。

与此相反,output_strategy = "periodic" 将始终在周期结束时输出一个 final 指标,无论最后一个指标何时到达,都会忽略 series_timeout

Metrics

测量和标签保持不变,字段会以 _final 后缀的形式发出。

示例输出

counter,host=bar i_final=3,j_final=6 1554281635115090133
counter,host=foo i_final=3,j_final=6 1554281635112992012

原始输入

counter,host=bar i=1,j=4 1554281633101153300
counter,host=foo i=1,j=4 1554281633099323601
counter,host=bar i=2,j=5 1554281634107980073
counter,host=foo i=2,j=5 1554281634105931116
counter,host=bar i=3,j=6 1554281635115090133
counter,host=foo i=3,j=6 1554281635112992012

此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2