graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Healthcheck for graph-node docker image

Open chrisdotn opened this issue 2 years ago • 4 comments

Description

The docker image for the graph-node doesn't contain a health check. It would be useful to have a simple way of checking the health of a graph node in the docker image automatically.

Docker health checks are meant to provide a very simple check if the relevant application is running correctly. They should be quick and cheap so that they can execute frequently. In the graph-node case this would be a check if the graph node is up and running and not a check for a particular subgraph.

Proposal

As graph-node doesn't have a native health check, the fairly simple command to check if the node is up and running would be a GraphQL request:

query getVersion {
  version {
    version
  }
}

should return the version of the node. To run this as a shell command, we could use:

curl -s http://localhost:8030/graphql -H 'Content-Type: application/json'  -d '{"query": "query getVersion { version { version } }" }' -f -m 2

The command runs inside the docker container. However, the default docker image does not provide curl. So the proposal is two-fold:

  1. Add a curl dependency to the docker image (i.e. apt-get -y install curl in the docker file)
  2. Add a health check command to the docker file.

If there is interest in this, I'm happy to create a PR for it.

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No

Some information to help us out

  • [X] Tick this box if you plan on implementing this feature yourself.
  • [X] I have searched the issue tracker to make sure this issue is not a duplicate.

chrisdotn avatar Jun 13 '24 15:06 chrisdotn

HI @chrisdotn, are you planning to create a PR for this change? It would be very useful, actually

mrbytesnook avatar Jul 17 '24 12:07 mrbytesnook

we don't even need a special graphql query. We can just have a route for /health and /ready so we can define liveness and readiness probes

saihaj avatar Jul 17 '24 19:07 saihaj

Looks like this issue has been open for 6 months with no activity. Is it still relevant? If not, please remember to close it.

github-actions[bot] avatar Jan 30 '25 00:01 github-actions[bot]

Hi!

We're refreshing the graph-node issue backlog to help focus on current priorities and make it easier to track and address relevant issues. As part of this cleanup, we're closing issues created in 2025 or earlier.

If this issue is still relevant, please open a new issue (linking back to this one) or leave a comment here with any updated context and tag @dimitrovmaksim, so we can reassess and prioritize it.

Thank you for your contributions to graph-node! 🙏

dimitrovmaksim avatar Oct 21 '26 08:10 dimitrovmaksim