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

Create health check package and basic implementation #6938

Open
mobyvb opened this issue Apr 25, 2024 · 0 comments
Open

Create health check package and basic implementation #6938

mobyvb opened this issue Apr 25, 2024 · 0 comments
Labels
Needs Estimation Issue still needs story pointing Needs Grooming

Comments

@mobyvb
Copy link
Member

mobyvb commented Apr 25, 2024

The goal of this task is to create a way for the satellite to internally monitor its own health, and then serve information about the health of these services over an endpoint that can be monitored for orbiter checks. This way, if one of these internal services breaks, orbiter can use this endpoint to determine whether the on-call engineer should be paged.

Example of a possible HealthCheck interface:

type HealthCheck interface {
   Ready() bool
   Healthy() bool
   Name() string
}

AC:

  • Create a generic "health check" package (e.g. in storj/private/healthcheck) for the interface and server definition
  • Define a basic HealthCheck interface - this should define a basic function that returns true/false based on whether a single service is healthy, as well as a function for getting a unique "check name" to be used in endpoint definitions and JSON responses
  • Define a basic HealthCheckServer along with a constructor
    • individual health checks can be added to the service
      • e.g. during instantiation like NewHealthCheckServer(ctx context.Context, checks ...HealthCheck)
      • or e.g. after instantiation like healthCheckServer.AddCheck(check HealthCheck)
    • the server, when run, serves GET endpoints to check overall health:
      • e.g. GET /health -> returns JSON with {checkName1: true, checkName2: false, ...}; status 200 if all healthy, 5xx otherwise
      • individaul endpoints e.g. GET /health/checkName -> returns true or false; status 200 if true and 5xx if false
  • Implement health check interface in Stripe service package - the Healthy() check should call a Stripe endpoint and return true/false depending on whether it gets an error response
  • Add health check server to satellite API peer, and add Stripe health check to this health check server - health check server should run on its own port, separate from the console API/metainfo servers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Estimation Issue still needs story pointing Needs Grooming
Projects
None yet
Development

No branches or pull requests

1 participant