Skip to content

feat(api): add /healthz + /readyz probes, deprecate /health + /ready - #213

Merged
taitelee merged 9 commits into
mainfrom
health-endpoints
Jun 3, 2026
Merged

feat(api): add /healthz + /readyz probes, deprecate /health + /ready#213
taitelee merged 9 commits into
mainfrom
health-endpoints

Conversation

@taitelee

@taitelee taitelee commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Adopts the Kubernetes-convention health-probe names from #144: GET /healthz (liveness) and GET /readyz (readiness) are now the canonical paths. The existing /health and /ready are kept as deprecated aliases of the same handlers for the v0.1.x line and are slated for removal in v0.2.0 — so nothing breaks for anyone already probing the old paths. Response bodies are unchanged (/healthz{"status":"ok"}, /readyz{"status":"ready"}, same boot-gated 503s as before).

WaveHouse's own tooling is repointed at the canonical names so it doesn't ride an alias we've announced for removal: the distroless health subcommand, the e2e orchestrator's readiness wait, the SDK e2e setup probe, and both Dockerfile HEALTHCHECKs. The prometheus.path reserved-collision check now also covers /healthz + /readyz, and the tracing span-skip middleware excl probe paths. Docs, AGENTS.md, and CHANGELOG.md updated to match.

Part 2 of #144 is deferred: the per-dependency drill-down probes under /healthz/{clickhouse,nats,schema,dlq} and the richer aggregate {"ready", "checks"} readiness body are left for a follow-up. This PR is a pure rename + alias.

Related Issues

Part of #144 (part 1: /healthz + /readyz rename + aliases). Intentionally not Closes — part 2 (per-dependency probes, aggregate readiness body) is deferred.

@github-actions github-actions Bot added documentation Improvements or additions to documentation go Pull requests that update go code area/api HTTP handlers, routing, middleware area/query Structured query AST, SQL builder area/sdk TypeScript SDK (clients/ts/) area/docs Documentation, site/, README area/infra CI, build, deploy, Docker, release labels Jun 3, 2026
@github-actions
github-actions Bot requested a review from EricAndrechek June 3, 2026 01:08
@taitelee taitelee moved this from Backlog to Ready in WaveHouse Task Board Jun 3, 2026
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR migrates health probe endpoints from legacy naming (/health, /ready) to Kubernetes-canonical naming (/livez, /readyz), introduces a new public SDK liveness endpoint (/v1/health), and updates routing, validation, clients, and documentation throughout the codebase.

Changes

Kubernetes Health Probe Endpoints

Layer / File(s) Summary
New SDK /v1/health endpoint
internal/api/health.go, internal/api/health_test.go, internal/api/router.go, internal/api/router_test.go, clients/ts/src/sys.ts, clients/ts/src/namespaces.test.ts, clients/ts/src/types.ts, clients/ts/src/index.ts
A new public /v1/health endpoint returning content-free 200/503 status is registered for SDK reachability checks. TypeScript SDK health() method now targets /v1/health with return type Result<void> instead of Result<Health>. The legacy Health response type is removed from client exports.
Canonical probe routing
internal/api/health.go, internal/api/router.go, internal/api/router_test.go, clients/ts/src/sys.ts
Router registers /livez and /readyz as canonical Kubernetes liveness/readiness endpoints, with /healthz as a permanent alias and /health//ready as deprecated aliases. Tracing span creation skips probe paths to reduce observability noise. TypeScript ready() method targets /readyz instead of /ready.
Boot-time degraded and recovery semantics
internal/api/health.go, internal/api/health_test.go, internal/api/boot_chain_test.go, tests/integration/boot_resilience_test.go
BootState documentation describes /livez returning 503 during schema-discovery retry and 200 after recovery. Health handler tests assert /livez and /readyz behavior across boot phases. Integration tests validate sticky /livez (remains 200 post-boot) vs conditional /readyz (503 on post-boot ClickHouse outage).
CLI and orchestration probe updates
cmd/wavehouse/health.go, cmd/wavehouse/health_test.go, cmd/wavehouse/main.go, scripts/orchestrator/main.go, tests/e2e/sdk/setup.ts, deployments/Dockerfile, deployments/Dockerfile.goreleaser
The wavehouse health CLI command and all probe callers (orchestrator startup wait, E2E setup, Docker HEALTHCHECK) are updated to check /livez instead of /health. Boot-time operator guidance logs and comments reference /livez degraded behavior.
Prometheus reserved path validation
internal/config/config.go, internal/config/config_test.go
Prometheus path validation expands reserved endpoints from {/health, /ready} to {/livez, /readyz, /healthz, /health, /ready} to prevent shadowing of canonical and alias probe routes.
Schema discovery diagnostic references
internal/discovery/discovery.go, internal/discovery/discovery_test.go
Schema retry diagnostic comments updated to reference /livez for showing boot-degraded state. Test comment reflowed without logic changes.
Documentation and changelog
AGENTS.md, CHANGELOG.md, docs/src/content/docs/{api,architecture,deployment,development,sdk}.md
Agent guidance, changelog, and all documentation define /livez and /readyz as Kubernetes canonical endpoints, /healthz as permanent alias, /health and /ready as deprecated v0.1.x aliases slated for v0.2.0 removal. API docs include a liveness-vs-readiness behavior matrix and clarify /v1/health as a public SDK liveness ping.
Go toolchain version
go.mod
Go version requirement updated from 1.26.3 to 1.26.4.

🎯 3 (Moderate) | ⏱️ ~25 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Jun 3, 2026
@taitelee

taitelee commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@EricAndrechek EricAndrechek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A quick google make it appear as though k8s has deprecated or started phasing out /healthz and recommending /readyz and /livez instead – considering we are starting from scratch here we should probably conform with the current recommendations. I also don't know what the norms are for what each endpoint must return, or what cases they return success/failures in, so additional implementation work may be needed to get it all conforming properly.

Then we also need to work out whether we need /healthz for backwards compatability with older k8s versions or not, and how (if at all) it will differ.

We also need to think about which if any of these endpoints is what we'd want to use for the docker compose health checks, and which our own e2e orchestrator uses, and what if anything should be returned along with those routes.

I also am thinking/wondering, but am unsure on the hosting and deployment conventions, if /readyz, /livez, /healthz etc. are usually on the same port/exposed to traffic like this or not. As we have it now as I understand it, if WaveHouse's port is forwarded to the internet, these k8s endpoints become public for anyone to query, whereas (I think I can't remember for sure) we had it setup so that the prometheus metrics, for instance, could optionally be hosted on a different port. Ideally it'd be the same port, or a competent devops person deploying this would filter those paths out at the reverse proxy layer so they were only addressable internally, but unsure if we should build that in as a feature too or not, worth looking into what the k8s norm is.

I DO think, however, we should have a public facing /health and/or /live or /ready or similar, that simply returns 200 OK or an error and likely no content (so we don't need to do JSON encoding on each request and don't need to cache anything), specifically for use in the SDK to check if a server is online before sending data, or to check if a particular server is healthy and accepting data when choosing between multiple in a distributed setup.

Happy to talk about this all more in person if needed today.

Comment thread clients/ts/src/http.test.ts
Comment thread cmd/wavehouse/health.go
Comment thread docs/src/content/docs/development.md
Comment thread tests/integration/boot_resilience_test.go Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
🚫 Deployment cancelled
View logs
wavehouse-docs fe26e9f Jun 03 2026, 03:20 PM

@EricAndrechek EricAndrechek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only want /v1/health accessible and used by API, not readiness.

Comment thread clients/ts/src/sys.ts
@github-project-automation github-project-automation Bot moved this from In review to In progress in WaveHouse Task Board Jun 3, 2026
@taitelee
taitelee merged commit 0be7038 into main Jun 3, 2026
7 of 8 checks passed
@taitelee
taitelee deleted the health-endpoints branch June 3, 2026 16:36
@github-project-automation github-project-automation Bot moved this from In progress to Done in WaveHouse Task Board Jun 3, 2026
EricAndrechek added a commit that referenced this pull request Jun 3, 2026
Resolves the CHANGELOG.md [Unreleased] conflict: keeps this branch's
"Lint/format coverage" + docs-deploy-from-CI-job entries alongside main's
new per-table-batching (#192) and health-endpoints (#213) entries, and
reconciles the stale "Project policies CardGrid" wording (that homepage
element was replaced by the closer call-to-action band on this branch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api HTTP handlers, routing, middleware area/docs Documentation, site/, README area/infra CI, build, deploy, Docker, release area/query Structured query AST, SQL builder area/sdk TypeScript SDK (clients/ts/) dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation go Pull requests that update go code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

feat(api): align health endpoints with K8s convention (/healthz, /readyz + per-dependency sub-endpoints)

2 participants