跳转至

内存


Memory 采集器用于收集系统内存信息,一些通用的指标如主机总内存、用的内存、已使用的内存等。

配置

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

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

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

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

配置好后,重启 DataKit 即可。

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

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

  • ENV_INPUT_MEM_INTERVAL

    采集器重复间隔时长

    字段类型: Duration

    采集器配置字段: interval

    默认值: 10s

  • ENV_INPUT_MEM_TAGS

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

    字段类型: Map

    采集器配置字段: tags

    示例: tag1=value1,tag2=value2

指标

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

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

mem

Tags & Fields Description
host
(tag)
System hostname.
active Memory used recently and normally not reclaimed unless necessary. Darwin and Linux only.
Type: int | (gauge)
Unit: digital,B
available Memory available for starting new applications without swapping, in bytes.
Type: int | (gauge)
Unit: digital,B
available_percent Available memory percentage, calculated as available / total * 100.
Type: float | (gauge)
Unit: percent,percent
buffered Memory used for kernel buffers. Linux only.
Type: int | (gauge)
Unit: digital,B
cached Memory used for the filesystem page cache. Linux only.
Type: int | (gauge)
Unit: digital,B
commit_limit Total memory currently available for allocation under the Linux overcommit policy. Linux only.
Type: int | (gauge)
Unit: digital,B
committed_as Estimated memory committed to allocations on the system. Linux only.
Type: int | (gauge)
Unit: digital,B
dirty Memory waiting to be written back to disk. Linux only.
Type: int | (gauge)
Unit: digital,B
free Free memory in bytes. Darwin and Linux only.
Type: int | (gauge)
Unit: digital,B
high_free Free high memory in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
high_total Total high memory in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
huge_pages_free Number of huge pages in the pool that are not allocated. Linux only.
Type: int | (gauge)
Unit: count
huge_pages_size Huge page size in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
huge_pages_total Total number of huge pages in the pool. Linux only.
Type: int | (gauge)
Unit: count
inactive Memory used less recently and more eligible for reclaim. Darwin and Linux only.
Type: int | (gauge)
Unit: digital,B
low_free Free low memory in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
low_total Total low memory in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
mapped Memory used for mapped files such as libraries. Linux only.
Type: int | (gauge)
Unit: digital,B
page_tables Memory used for the lowest level of page tables. Linux only.
Type: int | (gauge)
Unit: digital,B
shared Shared memory in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
slab Memory used by in-kernel data structure caches. Linux only.
Type: int | (gauge)
Unit: digital,B
sreclaimable Reclaimable part of slab memory, such as caches. Linux only.
Type: int | (gauge)
Unit: digital,B
sunreclaim Unreclaimable part of slab memory. Linux only.
Type: int | (gauge)
Unit: digital,B
swap_cached Memory that was swapped out, swapped back in, and still also exists in swap. Linux only.
Type: int | (gauge)
Unit: digital,B
swap_free Unused swap space in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
swap_total Total swap space in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
total Total physical memory in bytes.
Type: int | (gauge)
Unit: digital,B
used Used physical memory in bytes.
Type: int | (gauge)
Unit: digital,B
used_percent Used memory percentage, calculated as used / total * 100.
Type: float | (gauge)
Unit: percent,percent
vmalloc_chunk Largest contiguous free block in the vmalloc area. Linux only.
Type: int | (gauge)
Unit: digital,B
vmalloc_total Total size of the vmalloc area in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
vmalloc_used Used vmalloc area in bytes. Linux only.
Type: int | (gauge)
Unit: digital,B
wired Wired memory that cannot be paged out. Darwin only.
Type: int | (gauge)
Unit: digital,B
write_back Memory actively being written back to disk. Linux only.
Type: int | (gauge)
Unit: digital,B
write_back_tmp Memory used by FUSE for temporary writeback buffers. Linux only.
Type: int | (gauge)
Unit: digital,B

文档评价

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