-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a health-check endpoint /health
and CLI command
#3101
Comments
+1 - would be useful for the stats page too. Right now on stats I have this script that Docker is running on the container #!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status.
set -x # Print commands and their arguments as they are executed.
# Get the Yagna app key
KEY=$(yagna app-key list --json | jq -r '.[0].key')
if [ -z "$KEY" ]; then
echo "Key is empty, exiting."
exit 1
fi
# Use the key in the curl command
curl -H "Authorization: Bearer ${KEY}" 127.0.0.1:7465/me
The REST API might work fine but the rest of yagna doesnt for example when checking payment status... so i've needed to healthcheck multiple things. Not sure if it covers all possible scenarios even, so a proper health endpoint would be great. |
Issues with the stats page right now... checked the instance, healthcheck is not returning any errors as its able to fetch from the Yagna REST API
In this case The more I run yagna the more obscure ways I need to implement healthchecks because so many individuals things are failing while the rest seems fine. |
Now I re-ran the
|
Decided to detect the following problems for now:
Problems will be reported according to RFC 9457. |
@kamirr , we just recently encountered a situation where after 40 days of operation, the passive market scan was providing offers only for 2 providers and didn't see the rest. @prekucki , was made aware about the issue. My question is: will your implementation potentially detect this situation as well? |
I don't think so. I'll discuss this today with the rest of core and let you know if a case for this will be added (unless it is actually covered). |
Why?
There are multiple reasons why providing such an endpoint makes sense:
yagna
running in the docker container can be health-checked using that endpointWe could also have a
yagna health
CLI command which will inspect the status of the instance and provide some insights on it for the users so that it's going to be easier to troubleshoot.What would have to be changed?
Introduce the
/health
API endpointIf everything is fine, then it should return HTTP 200.
If something is wrong with that instance, then it should return HTTP 500 and the body can contain information about the error:
The list of potential reasons and checks can be filled in below:
Introduce the "health" command
This command can execute the same checks as the endpoint listed above.
If everything is fine, the exit code should be 0.
If anything is wrong, the exit code should be 1.
From the UI perspective, a "checklist" showing what was checked and what's the status of the check would be great for any sort of bug or issue reports done by the community.
For more context: when we were leading the DegenHack teams, they ended up in situations where over time they "didn't get any offers". Today, one has to know a series of commands to troubleshoot this particular issue. I believe that the types of checks, and especially the
health
command could output information that would be already providing enough guidance in troubleshooting common issues.The text was updated successfully, but these errors were encountered: