Health Checks

GLUEngine APIs have the ability to provide a standard pattern of health checks for APIs to in provide information on three core concepts:

Liveness Probes

/health/ready

or

/health/live

Purpose: To determine if a GLU.Engine is running and responsive.
Mechanism: To be used to periodically executes a liveness probe to check the GLU.Engine’s health. If the probe fails repeatedly (after a configurable threshold), action can be taken.
Supported Types:
TCP Socket Probe: Tries to establish a TCP connection to a specified port.
Exec Probe: Executes a command inside the container and checks the exit code (0 indicates success).
Consideration to approach to usage:
initialDelaySeconds: Delay before the first probe (allow container to start up).
periodSeconds: Time between probes.
timeoutSeconds: How long to wait for each probe to complete.
failureThreshold: Number of consecutive failures before restarting.

Readiness Probes

Purpose: To determine if a GLU.Engine is ready to serve traffic.
Mechanism: To be used to perform readiness probes after the GLU.Engine passes its liveness probe. If the readiness probe fails, the GLU.Engine should be removed from service endpoints, preventing it from receiving traffic until it becomes healthy again.
Common Types: Same as liveness probes (HTTP Get, TCP Socket, Exec).
Consideration to approach to usage: Similar to liveness probes, with the same parameters.

Startup Probe

Purpose: To determine if a GLU.Engine has started successfully.
Mechanism: Useful for GLU.Engines with longer startup times. GLU.Engine performs startup probes until one succeeds, then switches to liveness and readiness probes. If a startup probe fails repeatedly, the Pod is considered failed.
Common Types: Same as liveness probes (HTTP Get, TCP Socket, Exec).
Configuration: Similar to liveness probes, but also includes:
successThreshold: Number of consecutive successes required for a probe to be considered successful.

Setting Up API Query for Endpoint Information Using Connector Screens

This guide explains how to use the Connector screens in GLU.Ware to set up an API that queries detailed information about all endpoints used by an API to fulfill its methods. The resulting JSON configuration can be customized within these connector screens.

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"

Setting Up the API in GLU.Ware Connector Screens

  1. Access Connector Screen: Navigate to the connector configuration screens in GLU.Ware.
  2. Create or Edit Connector: Select the connector you wish to edit or create a new one.
  3. Configure API Settings:
  • Type: Set to HTTP Call.
  • Host: Enter the API URL (http://libracond-01.dev.flash.co.za:9288/health/full).
  • Method: Set to GET.
  • Response Configuration: Configure the expected JSON response fields as per your needs.
  1. Grouping and Tagging:
  • Group: Assign a group name (e.g., keycloak).
  • Tag: Assign relevant tags (e.g., hkey for Keycloak).
  1. Save and Test: Save the configuration and test the connector to ensure it retrieves and displays the information correctly.

By following this guide, you can effectively set up and configure the API to query endpoint information using the Connector screens in GLU.Ware, ensuring detailed and accurate monitoring of your API endpoints.

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