Skip to content

feat: Add health check #2247

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

Merged
merged 1 commit into from
May 14, 2025
Merged

feat: Add health check #2247

merged 1 commit into from
May 14, 2025

Conversation

blarghmatey
Copy link
Member

What are the relevant tickets?

N/A

Description (What does it do?)

Adds a health-check plugin and endpoint for monitoring pod status in Kubernetes

Screenshots (if appropriate):

  • Desktop screenshots
  • Mobile width screenshots

How can this be tested?

Ensure that the /health/, /health/liveness/, /health/startup/, /health/full/, and /health/readiness/ endpoints return successfully in a running instance.

Additional Context

In order to effectively manage Kubernetes applications we want to have startup, liveness, and readiness checks. This adds a package for exposing healthchecks that include information about the runtime status of the application.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a health-check plugin and endpoint for monitoring pod status in Kubernetes. It introduces new dependencies for health checks, updates URL routing to include health endpoints, and configures health-check subsets in the settings.

  • Added django-health-check and related packages in pyproject.toml.
  • Updated main/urls.py to include the health endpoint.
  • Configured health-check subsets in main/settings.py for startup, liveness, readiness, and full checks.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Updated dependencies with additions and removals to support health checks.
main/urls.py Added a new route for health check endpoints and updated static file routing.
main/settings.py Integrated new health-check apps and defined a detailed configuration for health check subsets.
Comments suppressed due to low confidence (1)

pyproject.toml:27

  • It appears that the Django dependency is being both added and removed. Please verify that Django is declared only once to avoid potential version conflicts.
-Django = "4.2.21"

@blarghmatey blarghmatey force-pushed the add_healthcheck branch 3 times, most recently from 46d9a77 to 000570c Compare May 12, 2025 19:02
blarghmatey added a commit to mitodl/ol-infrastructure that referenced this pull request May 12, 2025
We currently experience temporary 502s from the applications while they are doing a
deployment rollout. This adds startup, readiness, and liveness checks to the pods to
ensure that they are ready to serve traffic before they get incorporated into their
corresponding service. This depends on upstream changes in the applications in PRS:
- mitodl/mit-learn#2247
- mitodl/mitxonline#2652
@blarghmatey blarghmatey force-pushed the add_healthcheck branch 2 times, most recently from 8df938c to a906f29 Compare May 12, 2025 20:18
Copy link
Contributor

@shanbady shanbady left a comment

Choose a reason for hiding this comment

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

changes look good. I was seeing it return a bad status for celery and redis but I dont think that affects anything locally
Screenshot 2025-05-14 at 10 06 29 AM

@blarghmatey blarghmatey force-pushed the add_healthcheck branch 2 times, most recently from ceab62f to 7c36893 Compare May 14, 2025 17:28
In order to effectively manage Kubernetes applications we want to have startup,
liveness, and readiness checks. This adds a package for exposing healthchecks that
include information about the runtime status of the application.
@blarghmatey blarghmatey merged commit 07ff7cf into main May 14, 2025
13 checks passed
@blarghmatey blarghmatey deleted the add_healthcheck branch May 14, 2025 18:09
blarghmatey added a commit to mitodl/ol-infrastructure that referenced this pull request May 16, 2025
We currently experience temporary 502s from the applications while they are doing a
deployment rollout. This adds startup, readiness, and liveness checks to the pods to
ensure that they are ready to serve traffic before they get incorporated into their
corresponding service. This depends on upstream changes in the applications in PRS:
- mitodl/mit-learn#2247
- mitodl/mitxonline#2652
@odlbot odlbot mentioned this pull request May 16, 2025
11 tasks
blarghmatey added a commit to mitodl/ol-infrastructure that referenced this pull request May 16, 2025
We currently experience temporary 502s from the applications while they are doing a
deployment rollout. This adds startup, readiness, and liveness checks to the pods to
ensure that they are ready to serve traffic before they get incorporated into their
corresponding service. This depends on upstream changes in the applications in PRS:
- mitodl/mit-learn#2247
- mitodl/mitxonline#2652
blarghmatey added a commit to mitodl/ol-infrastructure that referenced this pull request May 16, 2025
We currently experience temporary 502s from the applications while they are doing a
deployment rollout. This adds startup, readiness, and liveness checks to the pods to
ensure that they are ready to serve traffic before they get incorporated into their
corresponding service. This depends on upstream changes in the applications in PRS:
- mitodl/mit-learn#2247
- mitodl/mitxonline#2652
This was referenced May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants