System
System 采集器收集系统负载、正常运行时间、CPU 核心数量以及登录的用户数。
配置¶
成功安装 DataKit 并启动后,会默认开启 System 采集器,无需手动开启。
采集器配置¶
进入 DataKit 安装目录下的 conf.d/samples 目录,复制 system.conf.sample 并命名为 system.conf。示例如下:
[[inputs.system]]
##(optional) collect interval, default is 10 seconds
interval = '10s'
[inputs.system.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
配置好后,重启 DataKit 即可。
可通过 ConfigMap 方式注入采集器配置 或 配置 ENV_DATAKIT_INPUTS 开启采集器。
也支持以环境变量的方式修改配置参数(需要在 ENV_DEFAULT_ENABLED_INPUTS 中加为默认采集器):
-
ENV_INPUT_SYSTEM_INTERVAL
采集器重复间隔时长
字段类型: Duration
采集器配置字段:
interval默认值: 10s
-
ENV_INPUT_SYSTEM_TAGS
自定义标签。如果配置文件有同名标签,将会覆盖它
字段类型: Map
采集器配置字段:
tags示例:
tag1=value1,tag2=value2
指标¶
以下所有数据采集,默认会追加名为 host 的全局 tag(tag 值为 DataKit 所在主机名),也可以在配置中通过 [inputs.system.tags] 指定其它标签:
system¶
Host-wide CPU, load, memory, process, user, and uptime summary metrics.
| Tags & Fields | Description |
|---|---|
| cpu_total_usage | Percentage of host CPU time currently in use. Type: float | (gauge) Unit: percent,percent |
| load1 | One-minute system load average. Type: float | (gauge) Unit: N/A |
| load15 | Fifteen-minute system load average. Type: float | (gauge) Unit: N/A |
| load15_per_core | Fifteen-minute load average normalized by logical CPU count. Type: float | (gauge) Unit: N/A |
| load1_per_core | One-minute load average normalized by logical CPU count. Type: float | (gauge) Unit: N/A |
| load5 | Five-minute system load average. Type: float | (gauge) Unit: N/A |
| load5_per_core | Five-minute load average normalized by logical CPU count. Type: float | (gauge) Unit: N/A |
| memory_usage | Percentage of host memory currently in use. Type: float | (gauge) Unit: percent,percent |
| n_cpus | CPU logical core count. Type: int | (gauge) Unit: count |
| n_users | Number of logged-in users. Type: int | (gauge) Unit: count |
| process_count | Number of processes currently running on the host. Type: int | (gauge) Unit: count |
| uptime | Time since the host last booted. Type: int | (gauge) Unit: time,s |
conntrack¶
Linux connection-tracking table usage and cumulative conntrack event counters.
| Tags & Fields | Description |
|---|---|
| host ( tag) |
hostname |
| entries | Current number of connections. Type: int | (gauge) Unit: count |
| entries_limit | The size of the connection tracking table. Type: int | (gauge) Unit: count |
| stat_drop | Cumulative number of packets dropped because connection tracking failed. Type: int | (count) Unit: count |
| stat_early_drop | Cumulative number of tracked entries dropped because the conntrack table was full. Type: int | (count) Unit: count |
| stat_found | Cumulative number of successful connection-tracking lookups. Type: int | (count) Unit: count |
| stat_ignore | Cumulative number of packets ignored by connection tracking. Type: int | (count) Unit: count |
| stat_insert | Cumulative number of new connection-tracking entries inserted. Type: int | (count) Unit: count |
| stat_insert_failed | Cumulative number of connection-tracking entry insert failures. Type: int | (count) Unit: count |
| stat_invalid | Cumulative number of packets that could not be tracked. Type: int | (count) Unit: count |
| stat_search_restart | Cumulative number of conntrack lookup restarts caused by hash-table changes. Type: int | (count) Unit: count |
filefd¶
Linux open file handle allocation and limit metrics.
| Tags & Fields | Description |
|---|---|
| host ( tag) |
hostname |
| allocated | The number of allocated file handles. Type: int | (gauge) Unit: count |
| maximum_mega | Maximum open file handles, expressed in millions. Type: float | (gauge) Unit: count |
FAQ¶
为什么没有 cpu_total_usage 指标?¶
CPU 部分采集功能不支持部分平台,如 macOS。