Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pluggable component for health check feature #254

Open
jeevatkm opened this issue Mar 30, 2019 · 3 comments
Open

Add pluggable component for health check feature #254

jeevatkm opened this issue Mar 30, 2019 · 3 comments
Labels

Comments

@jeevatkm
Copy link
Member

The goal is to create a pluggable component for health check feature in aah.

Goals:

Design:

  • Create a go library
  • Spec:
    • Provide an interface for implementing health check reporter
      • interface method func Check() error
    • Provide a method to create new health check component
    • Provide methods to add one or more health check reporter into health check registry with or without interval duration to call
      • e.g.: hc.AddReporter(healthcheck.Config{/* report name, implementation based on above interface, duration, skip on error, etc... */})
    • Provide a method to register controller and route for the aah application (by domain name if multiple domains application)
      • For non-Kubernetes - accept URL relative path for the route - returns the response payload with status code
      • For Kubernetes - to add liveness and readiness endpoints (accept URL relative path for the route for both endpoints) - return only status code with empty body since Kubernetes only cares about status code
  • Status Codes for response
    • 200 OK if every registered health checker/reporter returns nil
    • 503 Service Unavailable if any registered checker/reporter return non-nil except skip on error

Sample response payload (a conceptual idea, yet to be finalized)

{
	"status": "OK", // OK or Service Unavailable
	"timestamp": "RFC3339 or ISO 8061", // yet to be decided
	"reportname": bool, // true or false, this line will be repeated for all registered health checker/reporter
}
@jeevatkm
Copy link
Member Author

@adrianlop welcome 😄

@adrianlop
Copy link

I just pushed a basic PR here: https://github.com/go-aah/ec-healthcheck-provider/pull/1/files

let's discuss and review in there if you like!
cheers @jeevatkm

@jeevatkm
Copy link
Member Author

jeevatkm commented Apr 3, 2019

@adrianlop I have added Go vanity for aahframe.work/ec/health so available to use for try/test https://godoc.org/aahframe.work/ec/health

Until official release, please do go get aahframe.work/ec/health@master in your application to test/use it will update your go.mod with latest version of library every time you run it.

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

No branches or pull requests

2 participants