Create the configuration file ​
When running epazote
it defaults to the epazote.yml
configuration file, you can specify a different file using the -c
flag.
bash
$ epazote -c /path/to/epazote.yml
Basic configuration ​
The configuration file is a YAML file that contains the services you want to monitor, here is an example:
yaml
---
services:
app:
url: http://0.0.0.0:8080
every: 1m
expect:
status: 200
if_not:
cmd: systemctl restart app
In this example we are monitoring a service called app
that runs on http://0.0.0.0:8080
, we are checking the status code every minute and if the status code is not 200
we restart the service using systemctl restart app
.
run epazote ​
Within the same directory as the epazote.yml
file you can run epazote
:
bash
$ epazote -v
-v
flag is for verbose output
Metrics ​
After running epazote
you can access the metrics at http://0.0.0.0:9080/metrics
you can change the port using the
-p
flag
bash
$ curl 0:9080/metrics
Output example:
text
# HELP epazote_response_time_seconds Service response time in seconds
# TYPE epazote_response_time_seconds histogram
epazote_response_time_seconds_bucket{service_name="app",le="0.005"} 1
epazote_response_time_seconds_bucket{service_name="app",le="0.01"} 1
epazote_response_time_seconds_bucket{service_name="app",le="0.025"} 1
epazote_response_time_seconds_bucket{service_name="app",le="0.05"} 1
epazote_response_time_seconds_bucket{service_name="app",le="0.1"} 1
epazote_response_time_seconds_bucket{service_name="app",le="0.25"} 1
epazote_response_time_seconds_bucket{service_name="app",le="0.5"} 1
epazote_response_time_seconds_bucket{service_name="app",le="1"} 1
epazote_response_time_seconds_bucket{service_name="app",le="2.5"} 1
epazote_response_time_seconds_bucket{service_name="app",le="5"} 1
epazote_response_time_seconds_bucket{service_name="app",le="10"} 1
epazote_response_time_seconds_bucket{service_name="app",le="+Inf"} 1
epazote_response_time_seconds_sum{service_name="app"} 0.000298415
epazote_response_time_seconds_count{service_name="app"} 1
# HELP epazote_status Service status (1 = OK, 0 = FAIL)
# TYPE epazote_status gauge
epazote_status{service_name="app"} 1