Skip to content

Commit

Permalink
feat: Add health checks on integrations and service
Browse files Browse the repository at this point in the history
Signed-off-by: Loïc Saint-Roch <loic@nunchi.studio>
  • Loading branch information
loicsaintroch committed Jul 7, 2023
1 parent 36749a3 commit 0964d03
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions documentation/integration/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@ net.sock.peer.port: 50643
span.kind: "server"
```

## Health check

The `rest` integration allows to pass a custom HTTP handler function for health
check. It is exposed at `GET /health`.

Example:
```sh
$ curl --request GET \
--url http://localhost:8080/health
```

By default if no custom function is passed, the `rest` integration retrieves the
health status of each integration attached to the service running the `rest`
integration, and returns the highest HTTP status code returned. This means if all
integrations are healthy (status `200`) but one is temporarily unavailable (status
`503`), the HTTP status code would be `503`, and therefore the response body of
the health check would be:
```json
{
"status": "Service Unavailable"
}
```

## Usage

{% tab name="Go" %}
Expand Down

0 comments on commit 0964d03

Please sign in to comment.