Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Add heathcheck support #19

Closed
davidfowl opened this issue Mar 1, 2020 · 4 comments
Closed

Add heathcheck support #19

davidfowl opened this issue Mar 1, 2020 · 4 comments
Labels
Milestone

Comments

@davidfowl
Copy link
Member

We should add health checking support to the host to know if a service is running properly.

@rynowak rynowak added the idea label Mar 1, 2020
@rynowak rynowak added this to the backlog milestone Mar 3, 2020
@areller
Copy link
Contributor

areller commented Mar 21, 2020

@davidfowl I've experimented with it a bit and I have something in this branch https://github.com/areller/tye/tree/replica-health

Basically, you can define a health field in the service description that can be configured with these arguments

  • endpoint (The http endpoint that will be checked every interval for HTTP 2xx)
  • testInterval (The interval of the testing in seconds, default: 1)
  • gracePeriod (After a replica became sick, how many seconds to wait until we kill the replica, default: 5)
  • bootPeriod (After a replica has started, how many seconds to wait for it to become healthy before killing it, default: 5)

Here is an example yaml

# tye application configuration file
# read all about it at https://github.com/dotnet/tye
name: single-project-health
services:
- name: test-project
  project: test-project/test-project.csproj
  bindings:
    - port: 8081
  health:
    endpoint: /health

(Replicas of services without the health field will automatically become healthy upon creation)

The heart of this feature is in this file (and line)
https://github.com/areller/tye/blob/94e123bf9b0f3c01269cf5881aacf539b2517a85/src/Microsoft.Tye.Hosting/Hospital.cs#L135

This can be improved by

  • Adding another state, readiness (a replica can be healthy but not ready, in that case, we don't kill it)
  • Displaying health status/statistics in the dashboard

Once you have healthcheck (and maybe readiness) you can start talking about more advanced concepts like dependencies.

@davidfowl
Copy link
Member Author

@areller do you still want to work on this?

@areller
Copy link
Contributor

areller commented Apr 28, 2020

@davidfowl Sure! What do you think about the initial version (with the Hospital.cs file)? Is it a good direction?

@jkotalik
Copy link
Contributor

This is done!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants