Skip to content

Run Docker with HEALTHCHECK

Volker Hänsel edited this page Oct 6, 2023 · 2 revisions

URL /health

The service supports a web service at url /health to return the internal status

{
  "status": "Healthy",
  "results": {
    "exceptions_check": {
      "status": "Healthy",
      "description": "Healthy",
      "data": {
        "message": "currently 0 errors/min.",
        "error/min": 0
      }
    },
    "mqtt_check": {
      "status": "Healthy",
      "description": "MQTT Connected",
      "data": {
        "MQTT broker": "192.168.3.24:1883",
        "MQTT version": ""
      }
    }
  }
}

A HTTP return code of 200 verifies a healthy service state.

MQTT health state

  • when the MQTT broker is disconnected, the status is 'Degraded'
  • when the disconnect state exceeds the MqttDisconnectUnhealthy time (default 10 minutes) the service become 'Unhealthy'

Exceptions rate health state

The service monitors the number of internal exceptions (e.g. device connctions losses or transmit failures) as an ammount/minute rate.

  • when the rate exceeds ExceptionsHealthDegraded (default 10) the service become 'Degraded'
  • when the rate exceeds ExceptionsUnhealthy (default 40) the service become 'Unhelathy'