Collects Linux swap metrics from /proc
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This project will no longer be maintained by Intel. Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates. Patches to this project are no longer accepted by Intel. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project.

snap plugin collector - swap

snap plugin for collecting swap metrics from /proc linux filesystem

  1. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  3. License
  4. Acknowledgements

Getting Started

Plugin collects specified metrics in-band on OS level

System Requirements

  • Linux system


Download the plugin binary:

You can get the pre-built binaries for your OS and architecture at plugin's Github Releases page.

To build the plugin binary:


Clone repo into $GOPATH/src/github/intelsdi-x/:

$ git clone<yourGithubID>/snap-plugin-collector-swap

Build the plugin by running make in repo:

$ make

This builds the plugin in ./build/

Configuration and Usage

The path to the procfs can be provided in configuration as proc_path. If configuration is not provided, the plugin will use the default of /proc.

It can be set in the Snap global config that is loaded with snapteld, e.g.:

    "log_level": 1,
    "control": {
        "plugin_trust_level": 0,
        "plugins": {
            "collector": {
                "swap": {
                    "all": {
                        "proc_path": "/proc"


Collected Metrics

The list of collected metrics is described in


Example of running Snap swap collector and writing data to file.

Ensure Snap daemon is running:

  • initd: sudo service snap-telemetry start
  • systemd: sudo systemctl start snap-telemetry
  • command line: sudo snapteld -l 1 -t 0 &

Download and load Snap plugins:

$ wget
$ wget
$ snaptel plugin load snap-plugin-collector-swap
$ snaptel plugin load snap-plugin-publisher-file

See available metrics for your system:

$ snaptel metric list

Create a task manifest file to use snap-plugin-collector-swap plugin (exemplary files in [examples/tasks/] (

    "version": 1,
    "schedule": {
        "type": "simple",
        "interval": "5s"
    "workflow": {
        "collect": {
            "metrics": {
                "/intel/procfs/swap/device/*/used_bytes": {},
                "/intel/procfs/swap/device/*/used_percent": {},
                "/intel/procfs/swap/device/*/free_bytes": {},
                "/intel/procfs/swap/device/*/free_percent": {},
                "/intel/procfs/swap/all/cached_bytes": {},
            "config": {},
            "process": null,
            "publish": [
                    "plugin_name": "file",
                    "config": {
                        "file": "/tmp/published_swap.log"

Create a task:

$ snaptel task create -t swap-file.json


There isn't a current roadmap for this plugin, but it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release.

If you have a feature request, please add it as an issue and/or submit a pull request.

Community Support

This repository is one of many plugins in Snap, a powerful telemetry framework. See the full project at To reach out to other users, head to the main framework


We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in

And thank you! Your contribution, through code and participation, is incredibly important to us.


snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.