diff --git a/CHANGELOG.md b/CHANGELOG.md index 0223484..97ff0b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Rename the frame drop issue title. ([#315](https://github.com/getsentry/vroom/pull/315)) - Add new endpoint for regressed functions. ([#318](https://github.com/getsentry/vroom/pull/318)) +- Return 502 from health endpoint on shutdown. ([#323](https://github.com/getsentry/vroom/pull/323)) ## 23.9.1 diff --git a/cmd/vroom/main.go b/cmd/vroom/main.go index 48b8f2b..4d21b74 100644 --- a/cmd/vroom/main.go +++ b/cmd/vroom/main.go @@ -225,7 +225,11 @@ func main() { } func (e *environment) getHealth(w http.ResponseWriter, _ *http.Request) { - w.WriteHeader(http.StatusNoContent) + if _, err := os.Stat("/tmp/vroom.down"); err == nil { + w.WriteHeader(http.StatusNoContent) + } else { + w.WriteHeader(http.StatusBadGateway) + } } type Filter struct {