Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Check the services are running:
curl $OUTPOST_URL/api/v1/healthz
```

Wait until you get a `OK%` response.
Wait until you get a 200 response.

Create a tenant with the following command, replacing `$TENANT_ID` with a unique identifier such as "your_org_name", and the `$API_KEY` with the value you set in your `.env`:

Expand Down
14 changes: 14 additions & 0 deletions cmd/e2e/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ func (suite *basicSuite) TestHealthzAPI() {
Match: &httpclient.Response{
StatusCode: http.StatusOK,
},
Validate: map[string]interface{}{
"type": "object",
"properties": map[string]interface{}{
"status": map[string]interface{}{
"type": "string",
},
"timestamp": map[string]interface{}{
"type": "string",
},
"workers": map[string]interface{}{
"type": "object",
},
},
},
},
},
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/e2e/suites_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ type e2eSuite struct {
mockServerInfra *testinfra.MockServerInfra
cleanup func()
client httpclient.Client
appDone chan struct{}
}

func (suite *e2eSuite) SetupSuite() {
ctx, cancel := context.WithCancel(context.Background())
suite.ctx = ctx
suite.cancel = cancel
suite.appDone = make(chan struct{})
suite.client = httpclient.New(fmt.Sprintf("http://localhost:%d/api/v1", suite.config.APIPort), suite.config.APIKey)
go func() {
defer close(suite.appDone)
application := app.New(&suite.config)
if err := application.Run(suite.ctx); err != nil {
log.Println("Application failed to run", err)
Expand All @@ -48,6 +51,8 @@ func (suite *e2eSuite) SetupSuite() {
func (s *e2eSuite) TearDownSuite() {
if s.cancel != nil {
s.cancel()
// Wait for application to fully shut down before cleaning up resources
<-s.appDone
}
s.cleanup()
}
Expand Down
94 changes: 89 additions & 5 deletions docs/apis/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1686,17 +1686,101 @@ paths:
get:
tags: [Health]
summary: Health Check
description: Simple health check endpoint.
description: |
Health check endpoint that reports the status of all workers.

Returns HTTP 200 when all workers are healthy, or HTTP 503 if any worker has failed.

The response includes:
- `status`: Overall health status ("healthy" or "failed")
- `timestamp`: When this health check was performed (ISO 8601 format)
- `workers`: Map of worker names to their individual health status

Each worker reports:
- `status`: Worker health ("healthy" or "failed")

Note: Error details are not exposed for security reasons. Check application logs for detailed error information.
operationId: healthCheck
security: []
responses:
"200":
description: Service is healthy.
description: Service is healthy - all workers are operational.
content:
text/plain:
application/json:
schema:
type: object
required:
- status
- timestamp
- workers
properties:
status:
type: string
enum: [healthy]
example: healthy
timestamp:
type: string
format: date-time
description: When this health check was performed
example: "2025-11-11T10:30:00Z"
workers:
type: object
additionalProperties:
type: object
required:
- status
properties:
status:
type: string
enum: [healthy]
example: healthy
example:
status: healthy
timestamp: "2025-11-11T10:30:00Z"
workers:
http-server:
status: healthy
retrymq-consumer:
status: healthy
"503":
description: Service is unhealthy - one or more workers have failed.
content:
application/json:
schema:
type: string
example: OK
type: object
required:
- status
- timestamp
- workers
properties:
status:
type: string
enum: [failed]
example: failed
timestamp:
type: string
format: date-time
description: When this health check was performed
example: "2025-11-11T10:30:15Z"
workers:
type: object
additionalProperties:
type: object
required:
- status
properties:
status:
type: string
enum: [healthy, failed]
example: failed
example:
status: failed
timestamp: "2025-11-11T10:30:15Z"
workers:
http-server:
status: healthy
retrymq-consumer:
status: failed
# Tenants
/{tenant_id}:
parameters:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api
package apirouter

import (
"errors"
Expand Down
Loading
Loading