hashicorp / hashicorp/consul

Add a health status to indicate service not ready

Open
#2,608 2 comments 2 reactions 0 assignees View on GitHub
theme/health-checks thinking type/enhancement
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

Current Consul health status has these possible values: `passing`, `warning`, or `critical`. The `warning` status is caused by HTTP check response `429 Too Many Requests`, so `warning` actually means `busy`.

Let's check the life cycle of a service instance:
1. When it starts up, first goes into initialization
2. Everything is ok, ready for service.
3. Shutting down, perform some finalization job

Only in the 2nd stage the service should be in `passing` status. During startup and shutdown, it should not be `passing` otherwise external requests still come in. My service can not return `critical` during startup and shutdown, because critical will lead to session release/delete.

Can Consul add more health status to indicate the situation between passing and critical? I'd purpose to add a health status `no_ready`, which is mapped from HTTP check response `503 Service Unavailable`

Contributor guide

Open the contributing guide

Research direction

No files or tests are identified in the issue. Start by tracing Consul's health-status handling and the mapping from HTTP check responses to statuses. Done should include a distinct not-ready status for HTTP 503 that does not behave like passing or critical, while preserving the existing warning behavior for HTTP 429.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.