cardano-community / cardano-community/koios-cli

Health Check against an instance using CLI

Open
#1 5 comments 0 reactions 2 assignees Claimed by @mkungla View on GitHub
Dominant language
Go
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Description

It would be nice to have a a healthcheck ping from CLI against a specific instance (eg: `-b http://127.0.0.1:8053/api/v0` , that will check and report stats below behind the scenes (currently achieved via bash script [grest-poll.sh](https://github.com/cardano-community/guild-operators/blob/alpha/scripts/grest-helper-scripts/grest-poll.sh) ):

- [x] Query target's `tip` to check that the last block known to instance is within 600 seconds, use timeout of 2 seconds to establish connection to this endpoint (anything more being too slow to accept connection)
- [ ] Be able to verify (using `/` endpoint) that each path from spec is available at the target instance (current implementation [here](https://github.com/cardano-community/guild-operators/blob/alpha/scripts/grest-helper-scripts/grest-poll.sh#L101-L117))
- [x] Check every record in control table to check they're relatively recent (see [here](https://github.com/cardano-community/guild-operators/blob/alpha/scripts/grest-helper-scripts/grest-poll.sh#L119-L144) )
- [x] Check Observation [limit is uniform](https://github.com/cardano-community/guild-operators/blob/alpha/scripts/grest-helper-scripts/grest-poll.sh#L146-L152)
- [x] Do a [Get/POST to test a sample request](https://github.com/cardano-community/guild-operators/blob/alpha/scripts/grest-helper-scripts/grest-poll.sh#L154-L169)
- [x] Optionally - at the end of it all, with a debug argument (eg: `-d` ), provide a summary of the endpoint results.
- [x] Exit with return code 1 if any of the tests fail, and 0 if they all pass.

If all of the above is achievable, this will help us use something like `koios-cli healthcheck [-d]` for actual healthcheck from haproxy itself, as an alternative to using bash script we currently use.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.