Health Checks

Overview

The Health Checks allow you to configure and manage health checks for various services connected to your GLU.Engine instance. This guide will walk you through the setup process to ensure your services are correctly monitored and health checks are properly configured.

Setting up is complete in 2 parts. Initially for a GLU.Engine the Health Check Manager is used to configure and switch on the type of health check needed. Once this is done the connectors will need to be setup up with the details of the Endpoints which are used to check complete the health checks on.

See below details on these 2 parts

1. Health Check – Manager

Navigate to Health Check Manager

Navigate to Integration Builder

Choose a GLU.Engine and click on the Health Check Manager icon (see heart shaped icon below).

Switching on Health Check

Health checks can be switched on and configured for various states of your service i.e. Live, Ready, Full, and Startup. It also provides the ability to define a new health check state. See below which shows the Health Check Manager with endpoints for keycloak, slack and GLU Inbound and tabs for Live , Ready, Full and Startup.

To configure a ‘Live’ state:

a. Select the State:

• Click on the Live tab to configure the health check for the Live state of your service.

b. Setting Up Health Check Details:

Name: Assign a meaningful name for your health check. This value will be displayed on the tab. (e.g., Live)

Context: Define the endpoint context for the health check. This is the path which will be used to call the API (e.g., /health/live)

Collection Name: Specify a collection name to group related health checks. (e.g., Entries )

Active: Ensure the checkbox is selected to activate the health check. If the tick box is switched off then the Method will not be available as a method for the GLU.Engine API.

c. Adding Connectors:

Available Connectors: Select the services you want to include in the health check. In this example, you can see connectors like keycloak, slack and GLU Inbound.

Enable Connector: Click the checkbox next to the desired connector to include it in the health check. For instance, slack is enabled in this example. A “Error 404 Not Found” will be returned if an API is called for a Connector which is not enabled.

d. Configuring Connector Details:

Method: Choose the method for the health check. Options are HTTP or Ping. For slack, HTTP is selected. Please not the method will need to be configured in the connector to support the check see Health Check – Configuring a Connector below.

Group: Specify a group for organizational purposes. (e.g., Slack-Group)

Tag: Assign a tag to help identify and filter this health check. (e.g., Slack-Tag)

e. Saving the Configuration:

• Click Save to store your health check configuration.

f. Adding Additional Endpoints:

• It is possible to also add more endpoints, click on the Add Endpoint button and add in details as above.

Troubleshooting

• Ensure all required fields are filled out.

• Verify that the connectors are correctly selected and configured.

• Check that the endpoint contexts are unique and properly formatted.

• Make sure to click Save after making changes to preserve your configurations.


2. Configuring a Connector

Navigate to the Connectors screen

Choose a connector and edit it

Choose the appropriate environment and click on “Step 2: Connector Environment Settings.” Then, navigate to the “Health Check” tab.

In this screen, you can configure the endpoints for HTTP requests used to check the health of a service. Additionally, you can set up PING settings if the endpoint supports pinging to verify its health status.

Connector Environment Settings

  1. Select the Environment:
  • Choose the environment you wish to configure from the “ENVIRONMENTS” dropdown. In this case, select docker-hub-DeskTOP.

2. HTTP Setting Configuration:

  • URL: Enter the webhook URL to which the HTTP POST request will be sent. For Slack, this will be in the format https://hooks.slack.com/services/....
    • Example: https://hooks.slack.com/services/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.
  • Method: Select POST from the method dropdown as we are sending data to the server.

3. Request Body:

  • Enter the JSON payload to be sent with the HTTP request.
    • Example:
      json { "text": "Health check" }

4. Response Body to Validate:

  • Enter the expected response body to validate the health check.
    • Example: ok.

5. Ping Setting:

  • Optionally, specify a server to ping for checking network connectivity. This is not configured in the provided example.

6. Submit Configuration:

  • Review all settings.
  • Click on the Submit button to save the configuration.

3. API structure for health check

This explains how to access the Health Checks once the GLU.Engine has been built and deployed.

When GLU.Engine is up and running there will be an API exposed that provides details on endpoints. The path available will depend on the Health Check manager configuration. As an example if the FULL path is Active then the following method will be available.

API Endpoint

  • URL: http://<gateway-host>:<connector-port>/health/full
  • Method: GET

Response Format

The API returns a JSON object containing detailed information about the status and duration of each endpoint. Below is an example of the response:

{
    "status": "ALIVE",
    "totalDuration": "00:00:00.001482",
    "entries": {
        "keycloak": {
            "status": "ALIVE",
            "data": {},
            "tags": [
                "Hkey"
            ],
            "duration": "00:00:00.001074"
        },
        "slack": {
            "status": "ALIVE",
            "data": {},
            "tags": [
                "Slack-tag"
            ],
            "duration": "00:00:00.001482"
        }
    }
}

Response Fields

  • status: Indicates the overall status of the API.
  • Example: "ALIVE"
  • totalDuration: Shows the total time taken to query all endpoints.
  • Example: "00:00:00.001482"
  • entries: Contains individual entries for each endpoint.
  • keycloak: Represents the Keycloak endpoint.
    • status: Status of the Keycloak endpoint.
    • Example: "ALIVE"
    • data: Additional data related to the endpoint (currently empty).
    • Example: {}
    • tags: Tags associated with the Keycloak endpoint.
    • Example: ["Hkey"]
    • duration: Time taken to query the Keycloak endpoint.
    • Example: "00:00:00.001074"
  • slack: Represents the Slack endpoint.
    • status: Status of the Slack endpoint.
    • Example: "ALIVE"
    • data: Additional data related to the endpoint (currently empty).
    • Example: {}
    • tags: Tags associated with the Slack endpoint.
    • Example: ["Slack-tag"]
    • duration: Time taken to query the Slack endpoint.
    • Example: "00:00:00.001482"

4. Tips and Troubleshooting

Network Issues: If the health check fails, check network connectivity and ensure there are no firewall rules blocking the request.

Response Validation: Make sure the response body you expect (ok in this case) is accurate and matches the actual response from the server.

Was this article helpful?

Related Articles

Fill the form and we’ll contact you shortly

    I agree with

    cookies
    We uses cookies to make your experience on this website better. Learn more
    Accept cookies