Skip to content

Check external data sources in a separate health check category - #8198

Merged
labkey-jeckels merged 3 commits into
developfrom
fb_healthCheckOnlyLabKeyScope
Oct 19, 2026
Merged

labkey-jeckels merged 3 commits into
developfrom
fb_healthCheckOnlyLabKeyScope

Conversation

@labkey-jeckels

@labkey-jeckels labkey-jeckels commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

The default health check should fail only when the LabKey database is unreachable, while external data sources stay visible through a separate category. Today an unreachable external data source makes the default check return 503, so load balancers and probes pull or restart a server that is otherwise working, and neither action can fix an external database.

Changes

  • The default health check covers only the LabKey database.
  • External data sources are checked under a new externalDataSources category, for monitoring that wants an explicit signal; it also reports data sources that failed to connect. Their connection failure/reconnect logging now happens only when that category (or all) is polled.
  • Callers requesting categories=all see external data source failures as before.

Tasks

  • Claude Code Review
  • Manual Testing - not needed
  • Test Automation

Default health check failures take the server out of rotation, which can't fix an external database, so external data sources now report under the externalDataSources category.
@labkey-jeckels labkey-jeckels self-assigned this Oct 17, 2026
@labkey-jeckels

Copy link
Copy Markdown
Contributor Author

Example responses for a site admin, with the LabKey database labkey up and an external data source warehouse down. Non-admins get only {"healthy": true} or a 503.

Before: admin-healthcheck.api (default category) fails, so non-admins get a 503:

{
  "default": {
    "healthy": false,
    "details": {
      "database": { "healthy": false, "details": { "labkey": true, "warehouse": false } }
    }
  },
  "healthy": false
}

After: admin-healthcheck.api (default category) passes:

{
  "default": {
    "healthy": true,
    "details": {
      "database": { "healthy": true, "details": { "labkey": true } }
    }
  },
  "healthy": true
}

After: admin-healthcheck.api?categories=externalDataSources reports the outage, so non-admins get a 503:

{
  "externalDataSources": {
    "healthy": false,
    "details": {
      "database": { "healthy": false, "details": { "warehouse": false } }
    }
  },
  "healthy": false
}

Compatibility: the default response keeps its shape but no longer lists external data sources. categories=all still fails when an external data source is down. Older servers report categories=externalDataSources as unhealthy because the category doesn't exist there.

The default check no longer connects to external data sources, and the externalDataSources category reports ones that failed to connect. Adds HealthCheckTestCase.
@labkey-jeckels
labkey-jeckels merged commit 98c1c60 into develop Oct 19, 2026
10 checks passed
@labkey-jeckels
labkey-jeckels deleted the fb_healthCheckOnlyLabKeyScope branch October 19, 2026 17:09
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.

3 participants