serverpod-health-checks

Provide liveness, readiness, and startup health endpoints for Serverpod services.

3.2k|369|Updated May 22, 2021
One-click install
npx skills add https://github.com/serverpod/serverpod --skill serverpod-health-checks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serverpod-health-checks
Source: https://github.com/serverpod/serverpod/tree/main/packages/serverpod/skills/serverpod-health-checks
Command: npx skills add https://github.com/serverpod/serverpod --skill serverpod-health-checks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Server operators need reliable, probe-friendly health endpoints that clearly separate liveness from readiness and startup so orchestration systems (like Kubernetes) can make correct routing and restart decisions.

Core Features & Use Cases

  • Liveness endpoint: Use /livez to confirm the process is alive without checking dependencies.
  • Readiness endpoint: Use /readyz to report whether dependencies (like configured DB/Redis) are healthy and return 503 when they are not.
  • Startup endpoint: Use /startupz to indicate the server has finished initializing.
  • Built-in indicators: ServerpodStartupIndicator, DatabaseHealthIndicator, and RedisHealthIndicator (when enabled).
  • Custom health indicators: Add your own HealthIndicator implementations (for example, to check an external service) and register them via HealthConfig.

Quick Start

Configure your Serverpod instance with HealthConfig and add any custom readiness or startup indicators you need, then probe /livez, /readyz, and /startupz on port 8080.

Frequently Asked Questions about serverpod-health-checks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Kubernetes readiness and liveness probes for a Dart backend?

Configure your Serverpod instance with HealthConfig to expose Kubernetes-ready health endpoints, using /livez for liveness, /readyz for readiness, and /startupz for startup probes on port 8080.

What is the difference between liveness and readiness endpoints in Serverpod?

In Serverpod health checks, the liveness endpoint confirms the process is alive without checking dependencies, while the readiness endpoint reports whether dependencies like DB and Redis are healthy, returning 503 when they are not.

Can I add custom health indicators to check external services in Serverpod?

Yes, you can implement custom HealthIndicator classes to check external services and register them via HealthConfig, alongside built-in indicators like DatabaseHealthIndicator and RedisHealthIndicator.

Does Serverpod support authenticated JSON health responses for monitoring?

Yes, Serverpod health checks support authenticated RFC JSON health responses for detailed monitoring, as well as unauthenticated HTTP status-only responses returning 200 or 503 for Kubernetes probes.

How do I set timeouts for individual health indicators in Serverpod?

You can configure per-indicator timeouts and caching through HealthConfig when registering built-in and additional custom HealthIndicator implementations for your Serverpod backend service.

When do I need a startup probe instead of a liveness probe in Serverpod?

Use the /startupz endpoint to indicate the server has finished initializing, which is necessary when your Serverpod backend requires significant startup time before Kubernetes should begin liveness and readiness probing.