belgif / rest-guide

REST Guidelines of Belgian government institutions
https://www.belgif.be/specification/rest/api-guide/
Apache License 2.0
24 stars 4 forks source link

Standardize /health?type parameter #128

Closed jpraet closed 1 year ago

jpraet commented 1 year ago

I notice this is done in https://github.com/belgif/rest-guide-example, and wonder if it's a general recommendation to do this?

https://github.com/belgif/rest-guide-example/blob/1fcab76ddc385e01ab85dae96d5909f2b08f04a0/src/main/openapi/openapi.yaml#L525-L536

What is type=ping?

For the "default" vs "deep", I guess the "deep" check returns more additional details. This concept could be useful to standardize. If the server knows when it only needs to generate a default health response with a single status property, it can short-circuit the complete dependencies check:

pvdbosch commented 1 year ago

The "?type" param is an extension of the standard health operation, for use by internal monitoring tools. I'll check if we can remove it, because it may be confusing.

The "deep" option isn't accessible for external clients, cfr https://www.belgif.be/specification/rest/api-guide/#health :

When invoked by a client with additional health-check permissions, the resource MAY return additional details on the status of its subsystems or components. This internal information should be hidden from external clients for security reasons.

The WG decided in https://github.com/belgif/rest-guide/issues/13 to only standardize the use case of external clients.

Implementations are indeed not required to perform all health checks on each call, e.g. by short-circuiting or caching the previous health state for a short time.

pvdbosch commented 1 year ago

/health?type is removed in https://github.com/belgif/rest-guide-example/commit/33e9907c16a1b6ac81f7003c712a4486c950192c