Swap
Configuration¶
The swap collector is used to collect the usage of the host swap memory.
Collector Configuration¶
Go to the conf.d/host
directory under the DataKit installation directory, copy swap.conf.sample
and name it swap.conf
. Examples are as follows:
[[inputs.swap]]
##(optional) collect interval, default is 10 seconds
interval = '10s'
##
[inputs.swap.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
After configuration, restart DataKit.
Can be turned on by ConfigMap Injection Collector Configuration or Config ENV_DATAKIT_INPUTS .
Can also be turned on by environment variables, (needs to be added as the default collector in ENV_DEFAULT_ENABLED_INPUTS):
-
ENV_INPUT_SWAP_INTERVAL
Collect interval
Type: Duration
input.conf:
interval
Default: 10s
-
ENV_INPUT_SWAP_TAGS
Customize tags. If there is a tag with the same name in the configuration file, it will be overwritten
Type: Map
input.conf:
tags
Example: tag1=value1,tag2=value2
Metric¶
For all of the following data collections, a global tag named host
is appended by default (the tag value is the host name of the DataKit), or other tags can be specified in the configuration by [inputs.swap.tags]
:
swap
¶
- Tags
Tag | Description |
---|---|
host | hostname |
- Metrics
Metric | Description |
---|---|
free | Host swap memory total. Type: int Unit: digital,B |
in | Moving data from swap space to main memory of the machine. Type: int Unit: digital,B |
out | Moving main memory contents to swap disk when main memory space fills up. Type: int Unit: digital,B |
total | Host swap memory free. Type: int Unit: digital,B |
used | Host swap memory used. Type: int Unit: digital,B |
used_percent | Host swap memory percentage used. Type: float Unit: percent,percent |