utxostack / btc-assets-api

Bitcoin/RGB++ Assets API
https://api.rgbpp.io/docs
Apache License 2.0
4 stars 1 forks source link

[Discussion] Health Check Endpoint #55

Closed Flouse closed 7 months ago

Flouse commented 7 months ago

Example

{
  "status": "healthy" | "degraded" | "unhealthy",
  "checks": [
    {
      "name": "API Availability",
      "status": "healthy",
      "description": "API is responding with 200 OK"
    },
    {
      "name": "Queue function",
      "status": "healthy", 
      "description": "...."
    }
  ]
}

References

ahonn commented 7 months ago

Using upptime we need to consider:

ahonn commented 7 months ago

I added /healthcheck on the feat/healthcheck branch to perform health checks and return status. It can be viewed by visiting: https://btc-assets-api-healthcheck.vercel.app/healthcheck.

And created an upptime example: https://github.com/ahonn/upptime, used the above /healthcheck to obtain the status of dependent services and applications. But here it is through a single API, so Response Time has no meaning.

I'm not sure if we need to split different services or application status into separate APIs, such as /healthcheck/electrs, /healthcheck/queue ?

Flouse commented 7 months ago

I'm not sure if we need to split different services or application status into separate APIs, such as /healthcheck/electrs, /healthcheck/queue ?

I think one API is good enough.