文档文档

Telegraf 内部输入插件

此插件收集有关 telegraf 代理及其插件的指标。

一些指标是所有插件实例类型的聚合。

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

全局配置选项

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

配置

# Collect statistics about itself
[[inputs.internal]]
  ## If true, collect telegraf memory stats.
  # collect_memstats = true

  ## If true, collect metrics from Go's runtime.metrics. For a full list see:
  ##   https://pkg.go.dev/runtime/metrics
  # collect_gostats = false

  ## Collect statistics per plugin instance and not per plugin type
  # per_instance = false

Metrics

memstats 使用 Go runtime framework 收集

  • internal_memstats
    • alloc_bytes
    • frees
    • heap_alloc_bytes
    • heap_idle_bytes
    • heap_in_use_bytes
    • heap_objects_bytes
    • heap_released_bytes
    • heap_sys_bytes
    • mallocs
    • num_gc
    • pointer_lookups
    • sys_bytes
    • total_alloc_bytes

agent stats 收集所有 telegraf 插件的聚合统计信息。

  • internal_agent
    • gather_errors
    • gather_timeouts
    • metrics_dropped
    • metrics_gathered
    • metrics_written

internal_gather stats 收集所有相同输入类型的输入插件的聚合统计信息。它们带有 input=<plugin_name> version=<telegraf_version>go_version=<go_build_version> 标签。

  • internal_gather
    • gather_time_ns
    • metrics_gathered
    • gather_timeouts

internal_write stats 收集所有相同输出类型的输出插件的聚合统计信息。它们带有 output=<plugin_name>version=<telegraf_version> 标签。

  • internal_write
    • buffer_limit
    • buffer_size
    • metrics_added
    • metrics_written
    • metrics_dropped
    • metrics_filtered
    • write_time_ns

internal_<plugin_name> 是基于每个插件定义的指标,通常包含区分特定类型插件每个实例的标签以及 version=<telegraf_version>

  • internal_<plugin_name>
    • 单个插件特定的字段,例如请求计数。

特定插件的所有测量值都带有与每个特定插件相关的信息标签以及 version=<telegraf_version>

示例输出

internal_memstats,host=tyrion alloc_bytes=4457408i,sys_bytes=10590456i,pointer_lookups=7i,mallocs=17642i,frees=7473i,heap_sys_bytes=6848512i,heap_idle_bytes=1368064i,heap_in_use_bytes=5480448i,heap_released_bytes=0i,total_alloc_bytes=6875560i,heap_alloc_bytes=4457408i,heap_objects_bytes=10169i,num_gc=2i 1480682800000000000
internal_agent,host=tyrion,go_version=1.12.7,version=1.99.0 metrics_written=18i,metrics_dropped=0i,metrics_gathered=19i,gather_errors=0i,gather_timeouts=0i 1480682800000000000
internal_write,output=file,host=tyrion,version=1.99.0 buffer_limit=10000i,write_time_ns=636609i,metrics_added=18i,metrics_written=18i,buffer_size=0i 1480682800000000000
internal_gather,input=internal,host=tyrion,version=1.99.0 metrics_gathered=19i,gather_time_ns=442114i,gather_timeouts=0i 1480682800000000000
internal_gather,input=http_listener,host=tyrion,version=1.99.0 metrics_gathered=0i,gather_time_ns=167285i,gather_timeouts=0i 1480682800000000000
internal_http_listener,address=:8186,host=tyrion,version=1.99.0 queries_received=0i,writes_received=0i,requests_received=0i,buffers_created=0i,requests_served=0i,pings_received=0i,bytes_received=0i,not_founds_served=0i,pings_served=0i,queries_served=0i,writes_served=0i 1480682800000000000
internal_mqtt_consumer,host=tyrion,version=1.99.0 messages_received=622i,payload_size=37942i 1657282270000000000

此页面是否有帮助?

感谢您的反馈!


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