跳转至

Swap



swap 采集器用于采集主机 swap 内存的使用情况。

配置

成功安装 DataKit 并启动后,会默认开启 Swap 采集器,无需手动开启。

进入 DataKit 安装目录下的 conf.d/host 目录,复制 swap.conf.sample 并命名为 swap.conf。示例如下:

[[inputs.swap]]
  ##(optional) collect interval, default is 10 seconds
  interval = '10s'
  ##

[inputs.swap.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"

配置好后,重启 DataKit 即可。

可通过 ConfigMap 方式注入采集器配置配置 ENV_DATAKIT_INPUTS 开启采集器。

也支持以环境变量的方式修改配置参数(需要在 ENV_DEFAULT_ENABLED_INPUTS 中加为默认采集器):

  • ENV_INPUT_SWAP_INTERVAL

    采集器重复间隔时长

    Type: TimeDuration

    ConfField: interval

    Default: 10s

  • ENV_INPUT_SWAP_TAGS

    自定义标签。如果配置文件有同名标签,将会覆盖它

    Type: Map

    ConfField: tags

    Example: tag1=value1,tag2=value2

指标

以下所有数据采集,默认会追加名为 host 的全局 tag(tag 值为 DataKit 所在主机名),也可以在配置中通过 [inputs.swap.tags] 指定其它标签:

[inputs.swap.tags]
 # some_tag = "some_value"
 # more_tag = "some_other_value"
 # ...

swap

  • 标签
Tag Description
host hostname
  • 指标列表
Metric Description Type Unit
free Host swap memory total. int B
in Moving data from swap space to main memory of the machine. int B
out Moving main memory contents to swap disk when main memory space fills up. int B
total Host swap memory free. int B
used Host swap memory used. int B
used_percent Host swap memory percentage used. float percent

文档评价

文档内容是否对您有帮助? ×