Production Service Checklist
Here are the expectations for each go-service before deploying to production
- No error or warning from
golangci-lint
, template config use template golangci.yml config - Can be built
- Error output does not stutter, check error handling & logging. So that log messages to the point & not wasteful of storage.
- Implement context parameter sharing for each external call, check context parameter
- Implement healthcheck , can refer to http-restapi
- Graceful shutdown. Every time before the app is killed, give a chance for each request
/ an ongoing process to complete within a specified timeout.
In addition, aga can run optimally on a preemptible VM (cheaper).
The logic is roughly as follows:
- API/service is handling N-requests
- API/service suddenly receive kill signal (Ctrl-C, sigkill, etc)
- API/service return healthcheck NOK, then wait for t-seconds so that ongoing requests can be completed.
- API/service exit program