API di controllo dello stato

It would be nice to have some sort of health check API. We recently faced an issue with an update and Discourse was producing 500 errors.

However, curl returned 200:

curl -I https://forum.gitlab.com
HTTP/2 200
server: nginx
2 Mi Piace

This exists, see

/srv/status

15 Mi Piace

Ah, thank you! I was searching “health check” and that didn’t yield any results.

2 Mi Piace

Post is 404. What are the endpoints?

I’ve updated my post.

2 Mi Piace

Actually I don’t think /srv/status would catch migration issues like the one mentioned above…

(and it would be pretty hard to build a check that does catch issues like that one)

2 Mi Piace

Yes… /srv/status is there as a very cheap test, all it does is ensures the apps middleware stack is working.

To catch issues where you auto deploy I would recommend monitoring 200s, if there is a large increase in non 200s alert.

5 Mi Piace

https://discourse.example.org/srv/status sarebbe un buon punto di riferimento per un monitor di uptime? Penso che potrebbe non essere sufficiente per avere una misura affidabile di “se il sito è attivo”, ma sarebbe utile avere qualcosa che generi meno carico sul sistema a scopo di monitoraggio.

(In alternativa, ci potrebbero essere piani per espandere i componenti elencati in questo endpoint?)

3 Mi Piace

Sì, è un punto ragionevole. Se vuoi qualcosa di più avanzato, puoi anche puntare su un argomento specifico e cercare del testo.

7 Mi Piace

Sì, avevamo usato /about, ma eravamo propensi a usare questo invece.

La mia vecchia mentalità di ops/on-call si è risvegliata, facendomi pensare che potrebbe essere comunque interessante (e talvolta utile per la risoluzione dei problemi) se fosse qualcosa del genere:

db ok
middleware ok
qualcos'altro ok
...
tutti i sistemi ok
4 Mi Piace