Add status endpoint to seperate webserver #4441
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A short explanation of the proposed change:
Introduce a status endpoint under /internal/v4/status, which exposes more insights into the CC's health state.
An explanation of the use cases your change solves
When CC is facing a peak load of requests, currently the route will be deregistered and if the number of requests was too high, so that the processing takes longer than the timeout of the monit health check, the process will be restarted, even if Puma would be able to process all of the requests due to the queueing mechanism.
The /internal/v4/status endpoint gives more fine-granular insights in the health state of the CC. When at leats one Puma worker is idling it returns OK. If all workers are occupied, it returns BUSY. If all workers are busy and since 60s no requests have been processed, it returns UNHEALTHY. This endpoint will be used to prevent restarts even if CC is still healthy and working off peak-loads.
Links to any other associated PRs
cloudfoundry/capi-release#560
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
bundle exec rake
I have run CF Acceptance Tests