indeedeng / iwf

iWF is a WorkflowAsCode microservice orchestration platform offering an orchestration coding framework and service for building resilient, fault-tolerant, scalable long-running processes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add healthcheck API

longquanzheng opened this issue · comments

return format:

{
  "condition": "OK", # use constant value
  "hostname": "xxxxxx", # just return the hostname or IP
  "duration": 0  # return zero here is fine. 
}

Note 1

The format is required, because already defined in here and being used broadly at Indeed.

For duration, it means the time to calculate the health of the service in seconds.

For the first iteration(PR), we can just return zero.

For the second iteration, we can use Temporal/Cadence service client to perform the healthcheck like this:

_, err := serviceClient.CheckHealth(ctx, &client.CheckHealthRequest{})

and calculate the timeeslapsed of the API call. Because Temporal/Cadence is the only dependency of iWF.

Note 2:

We need to define a new API endpoint in the swagger: https://github.com/indeedeng/iwf-idl/blob/main/iwf.yaml#L13

The endpoint URL should be GET /info/healthcheck based on the Indeed standard.

@krishnaduttPanchagnula Are you working on this?

Thanks @krishnaduttPanchagnula @Rajan-226 for your interests.

To help you get started, I just added more details to help. LMK if you have any questions.

Thanks @longquanzheng, Will pick this up.

@longquanzheng Will complete this tomorrow, Can you check the draft once though: #327