0

Can Supervisord Perform health check by calling Health API of a node.js process. Or can we build something via using supervisord events? Or alternatively can supervisord execute a command to perform health check?

Sana.91
  • 1,999
  • 4
  • 33
  • 52
  • I feel what you need is to call the healthy check api at regular interval, it is like a cron job not what superviord is used for. – Qiulang Oct 11 '21 at 08:13
  • @Qiulang邱朗 there do exist such a plugin that performs this job via supervisor event listener .. supervisor_checks. check my answer in detail – Sana.91 Oct 27 '21 at 08:13

1 Answers1

2

We can install supervisor_checks which is a Framework to build health checks for Supervisor-based services.

We can use it like below in supervisord.conf

[eventlistener:MY_HTTP_check]
command=/usr/local/bin/supervisor_http_check -n MY_HTTP_check -N router -u http://127.0.0.1:6645/health -t 30 -r 3 -p 6645
events=TICK_5


arguments:
  -h, --help            show this help message and exit
  -n CHECK_NAME, --check-name CHECK_NAME
                        Health check name.
  -N PROCESS_NAME, --process-name PROCESS_NAME
                        Supervisor process name. Process group argument is
                        ignored if this is passed in
  -u URL, --url URL     HTTP check url
  -m METHOD, --method METHOD
                        HTTP request method (GET, POST, PUT...)
 
  -p PORT, --port PORT  HTTP port to query. Can be integer or regular
                        expression which will be used to extract port from a
                        process name.
  -t TIMEOUT, --timeout TIMEOUT
                        Connection timeout. Default: 15
  -r NUM_RETRIES, --num-retries NUM_RETRIES
                        Connection retries. Default: 2
Sana.91
  • 1,999
  • 4
  • 33
  • 52