Overview

PowerSync Service provides health check endpoints and configuration options to help you monitor the health and readiness of your deployment. These checks allow you to catch issues before they impact your users.

Health Check Endpoints

The following HTTP endpoints are available:

  • Startup Probe:
    GET /probes/startup

    • 200 – Service has started up correctly
    • 400 – Service has not yet started
  • Liveness Probe:
    GET /probes/liveness

    • 200 – Service is alive
    • 400 – Service is not alive

Example: Docker Health Checks

A configuration with Docker Compose might look like:

healthcheck:
  test: ["CMD", "node", "-e", "fetch('http://localhost:${PS_PORT}/probes/liveness').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"]
  interval: 5s
  timeout: 1s
  retries: 15

You can find a complete example in the self-host-demo app.

Advanced: Configurable Health Check Probes (v1.12.0+)

Starting with version 1.12.0, PowerSync Service supports configurable health check probes.
You can now choose between filesystem-based and HTTP-based probes, or use both, via the config file. This is especially useful for environments with restricted I/O.

Configuration options:

healthcheck:
  probes:
    use_filesystem: true   # Enables filesystem-based health probes
    use_http: true         # Enables HTTP-based health probes

If no healthcheck configuration is provided, the service defaults to the previous behavior for backwards compatibility.