Skip to content

Health Check Improvements #254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Health Check Improvements #254

wants to merge 18 commits into from

Conversation

stevensJourney
Copy link
Collaborator

@stevensJourney stevensJourney commented May 5, 2025

Overview

The PowerSync service uses a probing system to communicate health check statuses. Internally, the probe state is updated when the service becomes ready or active. This state is maintained in memory and can be exposed externally via the filesystem or HTTP endpoints.

Previously, probe state was always exposed via the filesystem by writing timestamps to .probes/startup, .probes/ready, and .probes/poll. This required the service to run with write access to the filesystem, which isn't always feasible or recommended. There was no way to disable filesystem probes.

In addition, the same probe state was exposed via HTTP routes, but only if the RouterEngine started an HTTP server. This occurred only in API and UNIFIED modes. In SYNC mode, the only way to access probe state externally was through the filesystem.

What's new

This PR introduces configurable probe types through the PowerSync configuration file. You can now enable or disable probe outputs via YAML:

  healthcheck:
    probes:
      use_filesystem: true
      use_http: true

The specified probe_types determine how probe state is exposed. Selecting http will now start an HTTP server even when running in SYNC mode.

Backwards compatibility
If no healthchecks configuration is provided, the service retains its previous behavior.

Implementation

Internally this moves some configuration from the service runner to a new shared module. This should remove some minor duplication throughout our hosted codebases.

Copy link

changeset-bot bot commented May 5, 2025

🦋 Changeset detected

Latest commit: 2aec7ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@powersync/service-core Minor
@powersync/service-image Minor
@powersync/service-types Minor
@powersync/lib-services-framework Minor
@powersync/service-module-core Minor
@powersync/service-core-tests Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-module-mongodb Patch
@powersync/service-module-mysql Patch
@powersync/service-module-postgres-storage Patch
@powersync/service-module-postgres Patch
test-client Patch
@powersync/lib-service-postgres Patch
@powersync/service-rsocket-router Patch
@powersync/lib-service-mongodb Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant