https://github.com/dipsas/healthchecknormalizer
Service for probing endpoints and generating a normalized health check
https://github.com/dipsas/healthchecknormalizer
endpoints healthcheck
Last synced: about 1 month ago
JSON representation
Service for probing endpoints and generating a normalized health check
- Host: GitHub
- URL: https://github.com/dipsas/healthchecknormalizer
- Owner: DIPSAS
- Created: 2022-10-25T10:52:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-28T11:52:29.000Z (over 3 years ago)
- Last Synced: 2025-02-27T16:18:44.443Z (over 1 year ago)
- Topics: endpoints, healthcheck
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Health Check Normalizer
This code fetches health checks for each endpoint related to the Testlab Environments and returns a normalized data set for each endpoint for use in e.g. dashboards.
This service runs within a Docker container, and needs to be built by exeucting the following:
```Bash
$ docker-compose build
```
When the image are built, start the container:
```Bash
$ docker-compose up -d
```
## Prerequisits
Docker and docker-compose must be working on the host.
## Configuration
The [configuration file](config.yaml) contains a section for _default values_ and specific configurations for each endpoint.
The syntax to use for a endpoint node which have only default values, looks like this:
```yaml
endpoints:
hostname.domain.no:
```
If a specific configuration for the endpoints instead is preferred, the following could be applied instead:
```yaml
endpoints:
hostname.domain.no:
port: 1234
request_uri: /api/endpointToGet
proto: https
method: get
```
The `method` parameter are at the moment only limited to `GET` requests, but will if needed be extended to support other methods such as `POST` requests.
## How does this work?
The Docker container runs the [start.sh](start.sh) script with the given [configuration file](config/config.yaml).
The given environments are defined within the configuration file.
The [start.sh](start.sh) script iterates through each environment and initiates the [main.py](main.py) against a given environment.
The [main.py](main.py) script iterates through each node host and retrieves all endpoints for a given environment.
Then each endpoint are probed against the given rules and a normalized JSON health format are outputted.
The JSON output standard are based on the [json_exporter standard](https://github.com/prometheus-community/json_exporter/blob/master/examples/data.json), which means the generated normalized health checks can be implemented in [Grafana](https://github.com/grafana/grafana) by using [Prometheus](https://github.com/prometheus/prometheus) and [json_exporter](https://github.com/prometheus-community/json_exporter).