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(deployment): add healthcheck for backend #564

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

AgustinRamiroDiaz
Copy link
Contributor

What

Adds a healthcheck for the backend service

Why

  • In other applications I want to build depending on the simulator (feedbuzz, intelligent oracles) I need to depend on this service in order to be able to make calls to it. Healthchecks are the way to go for specifying dependencies between containers
  • Healthchecks are a great idea in general

Testing done

  • tested the new feature
  • tested the bug fix

Decisions made

  • I've done it without using the tests module to not introduce module dependencies
  • I've done it with a Python script since CURL nor WGET are available in the image

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Reviewing tips

none

User facing release notes

The backend container now has a healthcheck! You can use this to depend on it in your applications building on top of GenLayer's simulator

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.35%. Comparing base (8416405) to head (42e1797).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #564   +/-   ##
=======================================
  Coverage   15.35%   15.35%           
=======================================
  Files         112      112           
  Lines        7950     7950           
  Branches      187      187           
=======================================
  Hits         1221     1221           
  Misses       6653     6653           
  Partials       76       76           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Copy link

sonarcloud bot commented Oct 15, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@YeagerAI-Bulat
Copy link
Collaborator

I wanted to suggest adding a /metrics API endpoint that can expose metrics in Prometheus format. This would be really helpful for monitoring and would allow us to collect and visualize various metrics about the application's behavior.
In addition, we could use this /metrics endpoint to perform health checks. This approach could give us more detailed insights about system health compared to a simple "heartbeat" check, as it would expose more granular metrics, making it easier to track performance and identify issues early on.

@AgustinRamiroDiaz AgustinRamiroDiaz merged commit de11898 into main Oct 15, 2024
16 of 18 checks passed
@AgustinRamiroDiaz
Copy link
Contributor Author

@YeagerAI-Bulat I agree, but having a /metrics endpoint is a whole issue in of itself, given that we currently don't have any metrics

Could you create an issue to track this request of having Prometheus metrics?

Copy link
Contributor

🎉 This PR is included in version 0.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@cristiam86 cristiam86 deleted the agustin/improve/docker-compose branch October 16, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants