Files
2023-11-09 11:48:27 +01:00

87 lines
1.6 KiB
Markdown

# Prometheus Latency Exporter
## Features
Available checks:
- TCP
- ICMP
- Redis
- MySQL
## Build
Requirements:
- git
- go
- make
```
git clone https://git.rznet.fr/tchivert/prometheus-latency-exporter.git
cd prometheus-latency-exporter
make
```
## Usage:
```
latency-exporter --help
Usage of latency-exporter:
-a string
address to use (default "0.0.0.0")
-c string
configuration file to use (default "config.yml")
-i int
time interval in seconds between two checks (default 30)
-p string
port to run on (default "9062")
-d
enable debug logs
```
## Configuration Example
```yml
services:
# TCP Check
- name: pytest
host: 127.0.0.1
port: 8000
# Host Ping Check
- name: server-test
host: 10.9.0.2
type: host
# Redis Check
- name: redis-test
host: 127.0.0.1
port: 6379
type: redis
# MySQL Check
- name: mysql-test
host: 127.0.0.1
port: 3306
type: mysql
username: prometheus
password: changeme
```
To perform host ping checks with an unprivileged user on Linux, you will need to execute the following command first:
```bash
sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"
```
Or just run it as root.
For more info: [ip-sysctl documentation](https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html)
## Acknowledgments
- [prometheus/client_golang](https://github.com/prometheus/client_golang)
- [prometheus-community/pro-bing](https://github.com/prometheus-community/pro-bing)
- [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)