2018-07-03 04:07:57 +08:00
|
|
|
# Swap Input Plugin
|
|
|
|
|
|
|
|
|
|
The swap plugin collects system swap metrics.
|
|
|
|
|
|
2022-06-09 05:22:56 +08:00
|
|
|
For more information on what swap memory is, read [All about Linux swap
|
|
|
|
|
space](https://www.linux.com/news/all-about-linux-swap-space).
|
2018-07-03 04:07:57 +08:00
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
2023-01-12 23:55:21 +08:00
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
|
2022-10-27 03:58:36 +08:00
|
|
|
|
2021-11-25 02:50:13 +08:00
|
|
|
## Configuration
|
2018-07-03 04:07:57 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2018-07-03 04:07:57 +08:00
|
|
|
# Read metrics about swap memory usage
|
|
|
|
|
[[inputs.swap]]
|
|
|
|
|
# no configuration
|
|
|
|
|
```
|
|
|
|
|
|
2021-11-25 02:50:13 +08:00
|
|
|
## Metrics
|
2018-07-03 04:07:57 +08:00
|
|
|
|
|
|
|
|
- swap
|
|
|
|
|
- fields:
|
2018-10-19 03:59:03 +08:00
|
|
|
- free (int, bytes): free swap memory
|
|
|
|
|
- total (int, bytes): total swap memory
|
|
|
|
|
- used (int, bytes): used swap memory
|
|
|
|
|
- used_percent (float, percent): percentage of swap memory used
|
|
|
|
|
- in (int, bytes): data swapped in since last boot calculated from page number
|
|
|
|
|
- out (int, bytes): data swapped out since last boot calculated from page number
|
2018-07-03 04:07:57 +08:00
|
|
|
|
2021-11-25 02:50:13 +08:00
|
|
|
## Example Output
|
2018-07-03 04:07:57 +08:00
|
|
|
|
2023-04-04 19:43:49 +08:00
|
|
|
```text
|
2018-07-03 04:07:57 +08:00
|
|
|
swap total=20855394304i,used_percent=45.43883523785713,used=9476448256i,free=1715331072i 1511894782000000000
|
|
|
|
|
```
|