Skip to content
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

feat: health check #104

Merged
merged 16 commits into from
Oct 16, 2023
Merged

feat: health check #104

merged 16 commits into from
Oct 16, 2023

Conversation

luislhl
Copy link
Contributor

@luislhl luislhl commented Sep 28, 2023

Acceptance Criteria

We should have a new /health endpoint, that will implement a more complex health check which includes:

  • Checking that there is at least 1 miner connected
  • Checking that the miners have at least 1 job submitted in the last hour (submitting a job is different than mining a transaction, there should be submitted jobs even if no transactions are being mined)
  • Checking that none of the jobs in the last 5 minutes failed
  • Checking that the jobs aren't taking more than 10 seconds to be mined
  • Checking the health of the Fullnode
    • For now we will only make sure its /v1a/version endpoint is responding. In future PRs we will use the new yet-to-be-implemented /v1a/health endpoint of hathor-core.

@luislhl luislhl self-assigned this Sep 28, 2023
@luislhl luislhl marked this pull request as ready for review October 3, 2023 15:16
@luislhl luislhl requested a review from msbrogli as a code owner October 3, 2023 15:16
@luislhl luislhl requested review from glevco and pedroferreira1 and removed request for msbrogli and pedroferreira1 October 3, 2023 15:21
Copy link
Contributor

@glevco glevco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall great PR, very well documented. I'm leaving some comments but most of them are optional.

txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
@luislhl luislhl requested a review from glevco October 5, 2023 14:08
txstratum/healthcheck/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck.py Outdated Show resolved Hide resolved
@luislhl luislhl removed the request for review from alexruzenhack October 9, 2023 18:16
@luislhl luislhl requested a review from tuliomir October 9, 2023 18:38
health_check = ComponentHealthCheck(
component_name=self.COMPONENT_NAME,
component_type=ComponentType.FULLNODE,
# TODO: Ideally we should not use private fields. We'll fix this when fixing line 170

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest naming the feature/command that is currently on line 170, as the line can change on maintenance PRs.

txstratum/healthcheck/healthcheck.py Outdated Show resolved Hide resolved
txstratum/healthcheck/healthcheck.py Outdated Show resolved Hide resolved
Co-authored-by: Tulio Miranda <tulio.mir@gmail.com>
@luislhl luislhl changed the base branch from master to dev October 16, 2023 22:06
@luislhl luislhl merged commit 047e302 into dev Oct 16, 2023
2 checks passed
@luislhl luislhl deleted the feat/health-check branch October 16, 2023 22:06
@tuliomir tuliomir mentioned this pull request Nov 28, 2023
This was referenced Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants