https://github.com/setlog/process_exporter
Export some prometheus metrics for processes matching a name.
https://github.com/setlog/process_exporter
Last synced: 23 days ago
JSON representation
Export some prometheus metrics for processes matching a name.
- Host: GitHub
- URL: https://github.com/setlog/process_exporter
- Owner: setlog
- License: mit
- Created: 2019-12-11T09:47:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:59:44.000Z (about 2 years ago)
- Last Synced: 2024-06-19T13:49:11.080Z (over 1 year ago)
- Language: Go
- Size: 8.32 MB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## process_exporter
Makes available the following metrics for Prometheus for processes matching a given name:
- CPU usage
- RAM usage
- Swap usage
- Disk IO (bytes)
- Disk IO (count)
### Requirements
- Go 1.13
### Building
```sh
./build.sh
```
### Usage
```sh
./process_exporter -namespace # Prometheus metric namespace (default: "my")
-binary # Name of binary to monitor
-nameflag # Infer value of "name"-label from value of this command line flag of monitored process (default: "name")
-port # Port to listen on for request (default: 80)
-interval # Interval between metrics being refreshed, in seconds (default: 10)
```
### Metrics
Example output from `curl localhost/metrics` for `process_exporter -binary top -nameflag d` for `top -d 1`. (Exploiting top's `-d` parameter as a unique identifier)
```sh
# HELP my_cpu Process CPU usage (%)
# TYPE my_cpu gauge
my_cpu{bin="top",name="1",pid="26436"} 3.0630784711756576
# HELP my_ram Process RAM usage (bytes)
# TYPE my_ram gauge
my_ram{bin="top",name="1",pid="26436"} 3.80928e+06
# HELP my_storage_read_bytes Total read from storage (bytes)
# TYPE my_storage_read_bytes gauge
my_storage_read_bytes{bin="top",name="1",pid="26436"} 0
# HELP my_storage_reads Total reads from storage
# TYPE my_storage_reads gauge
my_storage_reads{bin="top",name="1",pid="26436"} 27973
# HELP my_storage_write_bytes Total written to storage (bytes)
# TYPE my_storage_write_bytes gauge
my_storage_write_bytes{bin="top",name="1",pid="26436"} 0
# HELP my_storage_writes Total writes to storage
# TYPE my_storage_writes gauge
my_storage_writes{bin="top",name="1",pid="26436"} 91
# HELP my_swap Process swap usage (bytes)
# TYPE my_swap gauge
my_swap{bin="top",name="1",pid="26436"} 0
```
### TODO
- Network IO.