Skip to content

feat: add /health endpoint for container orchestration#2810

Merged
hayescode merged 3 commits intoChainlit:mainfrom
Br1an67:fix/issue-1866-health-endpoint
Mar 5, 2026
Merged

feat: add /health endpoint for container orchestration#2810
hayescode merged 3 commits intoChainlit:mainfrom
Br1an67:fix/issue-1866-health-endpoint

Conversation

@Br1an67
Copy link
Contributor

@Br1an67 Br1an67 commented Mar 1, 2026

What

Add a GET /health endpoint that returns {"status": "ok"}.

Closes #1866

Why

Container orchestration platforms (Azure Docker apps, Kubernetes, etc.) need a health check endpoint to monitor service availability. The existing HEAD / endpoint isn't suitable as it requires parsing HTML and doesn't follow health check conventions.

Changes

  • backend/chainlit/server.py: Added GET /health route
  • backend/tests/test_server.py: Added test for the health endpoint

Testing

  • Unit test passes: test_health_check verifies 200 response with correct JSON body

Summary by cubic

Add a GET /health endpoint that returns {"status":"ok"} for container health checks. Enables simple liveness/readiness probes for Kubernetes, Azure Docker apps, and similar platforms. Addresses #1866.

  • New Features
    • Added GET /health returning 200 with {"status":"ok"}.
    • Added unit test to verify status code and response body.

Written for commit df8e1bf. Summary will update on new commits.

Add a GET /health endpoint that returns {"status": "ok"} for use
with container health checks (Azure Docker, Kubernetes, etc.).
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 1, 2026
@dosubot dosubot bot added backend Pertains to the Python backend. unit-tests Has unit tests. labels Mar 1, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@hayescode hayescode added this pull request to the merge queue Mar 5, 2026
Merged via the queue into Chainlit:main with commit 8c8e583 Mar 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Pertains to the Python backend. size:S This PR changes 10-29 lines, ignoring generated files. unit-tests Has unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Health Check Endpoint

2 participants