Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

One GET endpoint for monitoring #684

Closed
5 of 6 tasks
Tbaut opened this issue Apr 21, 2020 · 6 comments · Fixed by #697
Closed
5 of 6 tasks

One GET endpoint for monitoring #684

Tbaut opened this issue Apr 21, 2020 · 6 comments · Fixed by #697

Comments

@Tbaut
Copy link
Collaborator

Tbaut commented Apr 21, 2020

Talking with @fevo1971 it would be great to build a super simple app (thinking about a nodejs express) that accept a GET call (e.g on /health) and this checks everything we have in our stack:

  • auth-server (either /health or/and an advanced query such as users)
  • chain-db-watcher (/health)
  • hasura (/healtz or/and an advanced query including remote joins such as a post, with author name and a referendum with status)
  • chain-db server (a graphql request for treasury proposal with status), or we should check if prisma has health-check
  • blockchain node (an RPC/api call with latest block number)
  • nodewatcher job, get the blockIndex in chain-db, then wait 10s and get it again, it should increment.
@Tbaut
Copy link
Collaborator Author

Tbaut commented Apr 22, 2020

This could be useful: https://github.com/Tbaut/chain-db-script

We basically just need to add the express part, the rest is a super simple graphql boilerplate, with TS and eslint already configured.

@Tbaut
Copy link
Collaborator Author

Tbaut commented Apr 22, 2020

ah, just saw your PR, my comment was a little late then :/

@niklabh
Copy link
Contributor

niklabh commented Apr 27, 2020

On Last point how can i wait 10 sec. I need to provide all service status in a single get call

@Tbaut
Copy link
Collaborator Author

Tbaut commented Apr 27, 2020

On Last point how can i wait 10 sec. I need to provide all service status in a single get call

With a promise and a settimeout. wouldn't that work?

@niklabh
Copy link
Contributor

niklabh commented Apr 27, 2020

But why wait 10 seconds for it. It will slow down healthcheck endpoint. Can't i query blockIndex. And keep a variable in memory changed since last time which gives the number of seconds since last change and do healthcheck value based on that variable

@Tbaut
Copy link
Collaborator Author

Tbaut commented Apr 27, 2020

Sure that would work as well, if the healthcheck is frequent enough.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants