# Simple Python I/O statistic exporter for Prometheus on FreeBSD
This is a simple ```iostat``` exporter as provider for the [Prometheus time series database
and monitoring system](https://prometheus.io/) written in Python. It uses
the [prometheus-client](https://github.com/prometheus/client_python) Python
package to do the main work of running the webservice and managing the gauges.
It's just a wrapper that periodically calls ```iostat``` to gather information
about disk I/O which is then provided on the specified TCP port where it's
collected by Prometheus at the specified scrape interval. This scraper
uses ```iostat``` to query the parameters __thus it only works on FreeBSD, not on Linux__.
Since this exporter scrapes the output of the CLI tools it may break with
any software update and might only work with particular versions of those
tools. It has been tested on:
* FreeBSD 11.2
* FreeBSD 12.2
* FreeBSD 12.3
## Exported metrics
For each disk the following parameters are exposed (using the device filename
as label):
* Reads per second (```iostat_rs```)
* Writes per second (```iostat_ws```)
* Kilobytes read per second (```iostat_krs```)
* Kilobytes written per second (```iostat_kws```)
* Milliseconds per read (```iostat_msr```)
* Milliseconds per write (```iostat_msw```)
* Milliseconds per operation (```iostat_mso```)
* Milliseconds per transaction (```iostat_mst```)
* Queue length (```iostat_qlen```)
* Busy percentage (```iostat_busy```)
## Installation
The package can either be installed from PyPI
```
pip install iostatexporter-tspspi
```
or form a package downloaded directly from the ```tar.gz``` or ```whl``` from
the [releases](https://github.com/tspspi/iostatexporter/releases):
```
pip install iostatexporter-tspspi.tar.gz
```
## Usage
```
usage: iostatexporter [-h] [-f] [--uid UID] [--gid GID] [--chroot CHROOT]
[--pidfile PIDFILE] [--loglevel LOGLEVEL]
[--logfile LOGFILE] [--port PORT] [--interval INTERVAL]
Iostat exporter daemon
optional arguments:
-h, --help show this help message and exit
-f, --foreground Do not daemonize - stay in foreground and dump debug
information to the terminal
--uid UID User ID to impersonate when launching as root
--gid GID Group ID to impersonate when launching as root
--chroot CHROOT Chroot directory that should be switched into
--pidfile PIDFILE PID file to keep only one daemon instance running
--loglevel LOGLEVEL Loglevel to use (debug, info, warning, error,
critical). Default: error
--logfile LOGFILE Logfile that should be used as target for log messages
--port PORT Port to listen on
--interval INTERVAL Interval in seconds in which data is gathered
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tspspi/iostatexporter",
"name": "iostatexporter-tspspi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Thomas Spielauer",
"author_email": "pypipackages01@tspi.at",
"download_url": "https://files.pythonhosted.org/packages/5f/b7/fdfe1b4b8459ddd29c131eda9f9e2efe5eefa3c1603425cf7e622440fa7e/iostatexporter-tspspi-0.0.1.tar.gz",
"platform": null,
"description": "# Simple Python I/O statistic exporter for Prometheus on FreeBSD\n\nThis is a simple ```iostat``` exporter as provider for the [Prometheus time series database\nand monitoring system](https://prometheus.io/) written in Python. It uses\nthe [prometheus-client](https://github.com/prometheus/client_python) Python\npackage to do the main work of running the webservice and managing the gauges.\nIt's just a wrapper that periodically calls ```iostat``` to gather information\nabout disk I/O which is then provided on the specified TCP port where it's\ncollected by Prometheus at the specified scrape interval. This scraper\nuses ```iostat``` to query the parameters __thus it only works on FreeBSD, not on Linux__.\n\nSince this exporter scrapes the output of the CLI tools it may break with\nany software update and might only work with particular versions of those\ntools. It has been tested on:\n\n* FreeBSD 11.2\n* FreeBSD 12.2\n* FreeBSD 12.3\n\n## Exported metrics\n\nFor each disk the following parameters are exposed (using the device filename\nas label):\n\n* Reads per second (```iostat_rs```)\n* Writes per second (```iostat_ws```)\n* Kilobytes read per second (```iostat_krs```)\n* Kilobytes written per second (```iostat_kws```)\n* Milliseconds per read (```iostat_msr```)\n* Milliseconds per write (```iostat_msw```)\n* Milliseconds per operation (```iostat_mso```)\n* Milliseconds per transaction (```iostat_mst```)\n* Queue length (```iostat_qlen```)\n* Busy percentage (```iostat_busy```)\n\n## Installation\n\nThe package can either be installed from PyPI\n\n```\npip install iostatexporter-tspspi\n```\n\nor form a package downloaded directly from the ```tar.gz``` or ```whl``` from\nthe [releases](https://github.com/tspspi/iostatexporter/releases):\n\n```\npip install iostatexporter-tspspi.tar.gz\n```\n\n## Usage\n\n```\nusage: iostatexporter [-h] [-f] [--uid UID] [--gid GID] [--chroot CHROOT]\n [--pidfile PIDFILE] [--loglevel LOGLEVEL]\n [--logfile LOGFILE] [--port PORT] [--interval INTERVAL]\n\nIostat exporter daemon\n\noptional arguments:\n -h, --help show this help message and exit\n -f, --foreground Do not daemonize - stay in foreground and dump debug\n information to the terminal\n --uid UID User ID to impersonate when launching as root\n --gid GID Group ID to impersonate when launching as root\n --chroot CHROOT Chroot directory that should be switched into\n --pidfile PIDFILE PID file to keep only one daemon instance running\n --loglevel LOGLEVEL Loglevel to use (debug, info, warning, error,\n critical). Default: error\n --logfile LOGFILE Logfile that should be used as target for log messages\n --port PORT Port to listen on\n --interval INTERVAL Interval in seconds in which data is gathered\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Simple Python I/O statistics exporter for Prometheus on FreeBSD",
"version": "0.0.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d3bf223fe0a9e7641d2ea75434ef026d8406693ad3192d11302aa5c35a351dd5",
"md5": "a74f17ccbe155295a40f9ca24c90b053",
"sha256": "5c533683ae5bee2b79083b689e6db3dd610f3349a0c18f733c819d3d4aa2997e"
},
"downloads": -1,
"filename": "iostatexporter_tspspi-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a74f17ccbe155295a40f9ca24c90b053",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6270,
"upload_time": "2023-01-04T22:55:19",
"upload_time_iso_8601": "2023-01-04T22:55:19.954205Z",
"url": "https://files.pythonhosted.org/packages/d3/bf/223fe0a9e7641d2ea75434ef026d8406693ad3192d11302aa5c35a351dd5/iostatexporter_tspspi-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5fb7fdfe1b4b8459ddd29c131eda9f9e2efe5eefa3c1603425cf7e622440fa7e",
"md5": "3073df6c0780026eb6828482f2a5553c",
"sha256": "60b742f481f6199a6da5fa1f723ed2ecb029eda21e645360847f552453a0fe10"
},
"downloads": -1,
"filename": "iostatexporter-tspspi-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "3073df6c0780026eb6828482f2a5553c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5436,
"upload_time": "2023-01-04T22:55:22",
"upload_time_iso_8601": "2023-01-04T22:55:22.131469Z",
"url": "https://files.pythonhosted.org/packages/5f/b7/fdfe1b4b8459ddd29c131eda9f9e2efe5eefa3c1603425cf7e622440fa7e/iostatexporter-tspspi-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-04 22:55:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "tspspi",
"github_project": "iostatexporter",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "iostatexporter-tspspi"
}