This tool can be used to wrap commands and report their outputs as Success
or Error
metrics (Counter
); this is useful when running health checks or probes as one can use Prometheus to monitor the results. It will transparently forward outputs but will exit
till Prometheus fetched the metrics.
./monitor <flags> <command> <arguments>
./monitor curl http://google.com
This configuration will run curl report success unless http://google.com
is unreachable and curl
returns a non zero exit code.
./monitor --success-pattern=E --error-pattern=E pytest
This configuration will run pytest
, scan stdout for E
and P
and reports successes and errors accordingly.