blitz_api icon indicating copy to clipboard operation
blitz_api copied to clipboard

add a availability / health check

Open cstenglein opened this issue 3 years ago • 2 comments

as a developer I would like the blitz/api to have some kind of availability / health check to see if the blitz api is there.

thus I would like to have an endpoint which should just return a response.

cstenglein avatar Aug 14 '22 13:08 cstenglein

Proposal:

A GET endpoint called system/health with an optional verbose flag. The verbose flag default will be false.

Result:

{
  "healthy": true,
  "message": "",
  "subsystems": [
    {
      "name": "api",
      "healthy": true
      "message": "",
    },
    {
      "name": "bitcoind",
      "healthy": true
      "message": "",
    },
    {
      "name": "lnd",
      "healthy": true
      "message": "",
    }
  ]
}

The subsystems data will only be returned when verbose is true. If one of the subsystems returns false, the top level healthy will be false and an API user might want to make a second call with verbose to true and display an error message to the user.

This will be a decent amount of work because we'd need to implement a status fetching mechanism to all the subsystems. This can be implemented in steps though. First iteration would be to only return the top level healthy to indicate whether the API is reachable.

fusion44 avatar Nov 29 '23 19:11 fusion44

@fusion44 sounds good for the first iteration for basically having a ping to see if the API is reachable and running. How to design the later stages can be decided later.

rootzoll avatar Dec 19 '23 13:12 rootzoll