-
Notifications
You must be signed in to change notification settings - Fork 92
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
New GET /v2/status API endpoint requested #618
Comments
2 & 3. This is going to be part of the diagnostic API. This is one of the deliverables in the protocol grant, and is being worked on. I don't know the release timing of that though. The json structure we figured would be added to over time as more things were added to the API return object. JSON allows for more things to be added without breaking reverse compatibility. Here is some partial work on the diagnostic API. I would love some feedback on the json structure. |
I don't think the status should involve itself in issues such as EC balance. The node is healthy but a user is using it incorrectly. Even if, at a minimum, there was just a way to hit the API with nothing more than a GET and all we got back was a 200 and a little JSON object that said "Hello World!" that would be an improvement over the current situation of getting a 400 back. We can wait for the diagnostic API to do the more heavy lifting, but the way it's working right now it's not really supporting generic health checks from services like CloudFlare in an elegant way. We've got a hack in place to make it work, but it's not ideal. |
ah, I see where the problem lies now. I had never considered cloudflare being a frontend for the factomd API. This is completely new thinking for me. I need to disappear for a bit, but I think I see where you are going with this. I don't know how easy it would be to have what you are asking for. it might be easy if there is something specific in one of the calls when something goes wrong. What are you trying to get a 200 code to represent? If you want to know if everything is working correctly, then that is something the node cannot know, ont for sure at least. It would involve something like watching the End Of Minute messages and seeing them come in at a regular interval. "operating properly" sounds like a fairly big ask. Getting some elements of that in the diagnostic API will certainly be a thing, but this sounds like a hard problem. I suppose it can know if some things are incorrect, like if it is booting up. There seems like a spectrum of (node definately not ready) through (everything seems to be chugging along fine as of now). Where to throw an error (since the Federated servers might be the ones having the problem, and your node is fine) is a hard problem. |
Yeah, determining whether the node is healthy is complex, and requires information from outside the node. That's not really what we're looking for here. We just want a superficial, "I'm ok!" endpoint for now. We have two different API clients that need information from the node:
So two different clients with different needs. One just needs a simple GET endpoint, the other will use the diagnostic API when it comes along. |
I'm curious if there has been any forward progress with this? Not having a GET health check URI on the API port is increasingly problematic for me. It's not just CloudFlare being difficult, but now Kubernetes also needs an endpoint that can be hit easily. Here is my new proposal: Change the response code on the API port's Right now, it returns a 404. That's it. If you could do that, I would have everything I need. |
This is still on the radar - there is a version that returns status here Lines 850 to 868 in aa0da08
NOTE: it was mentioned that it may be risky to poll the state repeatedly - it may impact performance In the control panel we keep a cache of current state data Lines 25 to 58 in aa0da08
Currently it's not an easy refactor to expose this to the RPC port but this source of data is safer to poll repeatedly than the global state object Also note: as mentioned above it is is not straightforward to decide if a node is ready to use - however as part of FD-869 see #720 we extended the control panel to report Ignore mode alongside the other heights - I believe https://github.com/BedrockSolutions/factomd-api-proxy will be able to make use of this in the short term. In the long term as part of a major refactor we'll try to get the proper status reported by the RCP endpoint |
@Emyrk may have some fresh thoughts about this. |
@jcheroske as far as a 200 status, would this suffice? https://docs.factom.com/api#properties As for accessing the ready state of the node, we do have plans in the refactor to expose more state related information, but determining a node is "ready" from a network point of view is difficult. I know some suggestions were made, and there is a new |
going into a rewrite - this is still on our radar |
The courtesy node grant team is requesting a new API endpoint. This endpoint will help us support several use cases that have arisen during our development:
Our monitoring bot needs a full-featured status report from the node that allows us to glean the following information:
In addition, other applications would probably find the following information useful:
I would like to discuss the structure of a JSON return payload that could support these use cases.
The text was updated successfully, but these errors were encountered: