Skip to content

Instantly share code, notes, and snippets.

@chicks-net
Last active January 11, 2018 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chicks-net/8165142860fc959e88c79fc24bae760a to your computer and use it in GitHub Desktop.
Save chicks-net/8165142860fc959e88c79fc24bae760a to your computer and use it in GitHub Desktop.
Health Check Best Practices

Health Check Best Practices

This is assumed to be in a webapp/SaaS context where there is plenty of http/https traffic already.

  • Do as little work in your health check as possible. It is like a CPU interrupt in that way.

  • Respond with an http status of 200 if all is well. Respond with 500 if there is a failure.

  • Optionally also include JSON in your response.

      {
        "status": "green",
        "name": "foo",
        "totalPipelines": 20,
        "totalSessions": 10,
        "avgResponseMs": 10
      }
    
  • If your web app stops acceptign connections when it gets busy then a side-channel is needed. Typically this would be done by creating a new http service on a new port that is able to determine the health of the web app of interest.

Additional reading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment