Skip to content

feat(template): declare a health check in app.yaml - #695

Merged
pffigueiredo merged 1 commit into
mainfrom
template-health-check
Oct 28, 2026
Merged

pffigueiredo merged 1 commit into
mainfrom
template-health-check

Conversation

@pffigueiredo

Copy link
Copy Markdown
Contributor

Why

Databricks Apps only waits for an app to answer before routing traffic to it when app.yaml declares a health_check. Without one, a new or waking app can receive traffic before its server listens, and the first page is an empty 502. Apps that scale to zero hit this on wake.

What

The template's app.yaml now declares:

health_check:
  path: /health

The server plugin already registers GET /health, which returns a static 200, and the server only starts listening once setup finishes. So a new app passes the check as soon as it is up, and the runtime routes traffic only after that.

Notes:

  • Only newly created apps get this. Existing apps keep their app.yaml.
  • If an app drops the server plugin or otherwise stops serving /health, its deploys wait for the health check timeout (300 seconds by default) and then fail.
  • Regenerating the app templates with tools/generate-app-templates.ts carries the change to them.

Testing

Rendered the template with databricks apps init (CLI 1.20.0), once with no env block and once with the analytics feature. Both produce valid YAML with health_check.path: /health and the expected command.

Without a health_check, Databricks Apps switches traffic to a new or waking
app before its server listens, so the first request can fail with an empty
502. The server plugin already serves GET /health, so declaring it makes the
runtime wait until the app answers before routing traffic to it.

Signed-off-by: Pedro Figueiredo <pedro.figueiredo@databricks.com>
@pffigueiredo
pffigueiredo requested a review from a team as a code owner October 28, 2026 12:08
@github-actions

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks CLI):

gh run download 40685395914 -R databricks/appkit -n appkit-template-0.89.0-pr.993a268-template-health-check-695 -D appkit-pr-695 \
  && unzip -o "appkit-pr-695/appkit-template-0.89.0-pr.993a268-template-health-check-695.zip" -d "appkit-pr-695" \
  && databricks apps init --template "appkit-pr-695"

The template pins @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

@pffigueiredo
pffigueiredo merged commit 4917a0c into main Oct 28, 2026
11 checks passed
@pffigueiredo
pffigueiredo deleted the template-health-check branch October 28, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants