All other languages

Oh Dear can monitor the health of any application, no matter which framework it uses or language is written in.

We will not run any health check from our end. Your application or infrastructure should run any desired checks. The results of the checks should be made available at an HTTP endpoint.

Every couple of minutes Oh Dear will visit that endpoint to get the check results. The endpoint URL can be configured at the application health settings screen.

screenshot

The request that Oh Dear sends to your app will contain a secret value in the oh-dear-health-check-secret header. To make sure that a request really comes from Oh Dear, you should verify if the secret value is correct.

Health check results format

That endpoint must return the health check results as JSON in a specific format.

The JSON should have two toplevel properties:

  • finishedAt: a unix timestamp indicating when these check did run on your server.
  • checkResults: an array with check results. This array can have 50 items maximum.

A check result should have these properties, they are all required:

  • name: this should be a unique value to identify this check. We'll use this value to synchronise the check results in our database.
  • label: a string describing your health check that we will display at the application health checks list.
  • status: a string that indicates what the result of the health check is. Check below for possible values.
  • notificationMessage: when a check results in warning or error, we'll use this string in the notification that we'll send to you. we'll also display it at the application health checks list.
  • shortSummary: a very short summary of the result of your check that will be displayed at the application health checks list.
  • meta: an array with keys and values that contain extra information about the check. You can send a maximum of 20 items in this array.

These are the possible values for status:

  • ok: the check ran ok
  • warning: the check is closed to failing
  • failed: the check did fail
  • crashed: something went wrong running the check itself
  • skipped: the check wasn't performed at all

Here's an example response that your server should return:

{
    "finishedAt": "1638879833",
    "checkResults": [
        {
            "name": "UsedDiskSpace",
            "label": "Used Disk Space",
            "status": "failed",
            "notificationMessage": "The disk is almost full (91% used)",
            "shortSummary": "91%",
            "meta": {
                "disk_space_used_percentage": 91
            }
        },
        {
            "name": "Redis",
            "label": "redis",
            "status": "ok",
            "notificationMessage": "",
            "shortSummary": "Available",
            "meta": []
        }
    ]
}

Was this page helpful to you? Feel free to reach out via support@ohdear.app or on Twitter via @OhDearApp if you have any other questions. We'd love to help!