This repo contains the health checks that are run on the Skynet Webportals
This service includes a standalone HTTP server that exposes health check API endpoints.
executing
node srcruns the server
By default the server runs on 0.0.0.0 port 3100 but you can configure those settings with environment variables HOSTNAME and PORT.
/health-checkreturns current health check status (shows only failed checks if any), response code will be 200 when status is up and 503 otherwise/health-check/criticalreturns critical checks (last 24 hours)/health-check/extendedreturns extended checks (last 24 hours)/health-check/disabledreturns information whether server is set to disabled
There are 2 types of checks in this service:
- critical: quick and cheap to run, failure of those checks should result in server being marked as failing (disabled)
- extended: set of popular or common skylinks that should be checked against less frequently to ensure server is in good condition
This service includes a cli binary that is accessible from bin directory and exposes some of the service' functionalities.
bin/clidisplays available commandsbin/cli run [critical|extended]executes health checks of given typebin/cli enabletoggles the health checkdisabledflag tofalsebin/cli disable <reason>toggles the health checkdisabledflag on with a given reason (ie. "down for maintenance")
There are also cli scripts in cli directory but those should be considered deprecated and are kept only for backwards compatibility.
Image of this service is available on dockerhub and is built from Dockerfile file found in root directory of this repository.
Docker image includes running HTTP API server in foreground and crontab configuration for running critical checks every 5 minutes and extended checks every 60 minutes. It also exposes cli binary directly on the container so you can use it like docker exec health-check cli enable.