parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.83k stars 4.77k forks source link

Extend health endpoint #8331

Open mtrezza opened 1 year ago

mtrezza commented 1 year ago

New Feature / Enhancement Checklist

Current Limitation

The /parse/health endpoint only returns a single key status: 'ok' without any contextual information such as:

Feature / Enhancement Description

Currently "status" is a final state that is only related to the final result of the server start. The suggestion is to make "status" a dynamic state that can change at anytime during runtime and returns the current server health throughout the server lifecycle. This would make the status more versatile for future server health features. One could set an alarm to continuously watch the server status. For example:

{
  status: "degraded",
  code: 1,
  warnings: [
    {
      code: 123,
      message: "Database connection fails."
    }
  ]
}

We could add the following status:

There could also be warnings and infos like:

{
  status: "ok",
  code: 0,
  warnings: [
    {
      code: 123,
      message: "Intermittent database connection errors."
    }
  ],
  infos: [
    {
      code: 124,
      message: "Android push notification certificate expires in 29 days."
    }
  ]
}

Example Use Case

n/a

Alternatives / Workarounds

n/a

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

Moumouls commented 1 year ago

@mtrezza I can suggest to add to the spec to only keep status key when master key is not provided. If master key is provided on the health endpoint it's safe to return additional & internal status.

Or a CLP object could be introduced to allow some users to access to the status details, and avoid a master key usage.

mtrezza commented 1 year ago

Yes, that's a good point. I think this whole feature needs some more thought. The discussion where this originally came up has evolved so that the HTTP response code now for example also changes depending on the status.