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

Add database and worker health endpoints #3947

Merged
merged 7 commits into from
Aug 22, 2023

Conversation

ThomasLaPiana
Copy link
Contributor

@ThomasLaPiana ThomasLaPiana commented Aug 21, 2023

Closes #3912

Description Of Changes

After removing the more robust/verbose healthchecks, we've found that they were actually useful and should be reinstated for debugging use as discrete endpoints that don't affect the general latency of /health

Code Changes

  • add a new healthcheck for the database at health/database and restore functionality to check migration status
  • add a new healthcheck for the workesr at health/workers and restore the previous functionality
  • slim down the existing health endpoint

Steps to Confirm

  • run the server with nox -s dev and verify the 3 endpoints in your browser/HTTP requester (/health, /health/database, /health/workers)

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Issue Requirements are Met
  • Update CHANGELOG.md
  • For API changes, the Postman collection has been updated

@ThomasLaPiana ThomasLaPiana self-assigned this Aug 21, 2023
@cypress
Copy link

cypress bot commented Aug 21, 2023

Passing run #3662 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 4711ed7 into 7bef8b4...
Project: fides Commit: 867678b038 ℹ️
Status: Passed Duration: 01:23 💡
Started: Aug 21, 2023 9:58 PM Ended: Aug 21, 2023 9:59 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 74.28% and project coverage change: -0.05% ⚠️

Comparison is base (7bef8b4) 87.40% compared to head (4711ed7) 87.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3947      +/-   ##
==========================================
- Coverage   87.40%   87.35%   -0.05%     
==========================================
  Files         318      318              
  Lines       19509    19533      +24     
  Branches     2504     2507       +3     
==========================================
+ Hits        17051    17063      +12     
- Misses       2024     2034      +10     
- Partials      434      436       +2     
Files Changed Coverage Δ
src/fides/api/db/database.py 78.87% <40.00%> (-9.01%) ⬇️
src/fides/api/api/v1/endpoints/health.py 86.20% <88.00%> (-6.11%) ⬇️

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

@ThomasLaPiana ThomasLaPiana marked this pull request as ready for review August 21, 2023 22:53
Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

lgtm! i like the approach of decoupling the potentially more complex health checks from the straightforward heartbeat: gives us that level of detail if needed, while keeping the heartbeat as lightweight as possible.

also, thanks for switching over to the shared API db session that respects the configured connection pool! 👍

@ThomasLaPiana
Copy link
Contributor Author

ThomasLaPiana commented Aug 22, 2023

FYI @daveqnet this should also remedy the connection pool woes we've been having and should close this issue:

#3918

However we can wait to confirm before closing it

@ThomasLaPiana ThomasLaPiana merged commit b3d1f17 into main Aug 22, 2023
36 of 38 checks passed
@ThomasLaPiana ThomasLaPiana deleted the ThomasLaPiana-add-additional-health-endpoints branch August 22, 2023 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor worker healthchecks
2 participants