hasura / hasura/graphql-engine

Extend /healthz failure to empty metadata

Open
#9,895 1 comment 1 reaction 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?

Applying metadata can take many seconds, if not minutes. During that time, `/healthz` reports `200 OK`, even with `strict=true`, because nothing is inherently wrong with Hasura. But I want consumers to handle empty metadata the same way as broken metadata.

And by "empty metadata" I mean whichever state the metadata is in when Hasura is launched for the very first time.

### Describe the solution you'd like

Add another argument to `/healthz` that returns 500 if metadata is empty. For example `/healthz?strict=true&empty=true` would return 500 if metadata is either inconsistent or missing.

### Describe alternatives you've considered

Using `export_metadata` to check for `{}` (presumably) is not a great idea, because I'd have to do it on 200 OK, and our metadata is enormous when present.

Contributor guide

Open the contributing guide

Research direction

Locate the /healthz handler and the existing strict=true behavior, then inspect how first-run metadata state is represented. Done means an empty=true query option returns 500 for empty or inconsistent metadata while preserving existing behavior otherwise, with tests covering the requested combinations.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.