Health check api - #5952
Draft
hazel-bohon wants to merge 2 commits into
Draft
Health check api#5952hazel-bohon wants to merge 2 commits into
hazel-bohon wants to merge 2 commits into
Conversation
hazel-bohon
requested review from
afprtclr and
mchamberlin77
and
a balanced review from Copilot
October 5, 2026 16:15
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Five-second polling currently forces license discovery and persistence access for every open ServicePulse client.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds a dedicated Platform Health API for ServicePulse, separating internal health reporting from customer custom checks.
Changes:
- Adds platform health inventory, alerts, licensing, and remote-instance metadata.
- Extends configuration discovery and remote probing.
- Adds unit, acceptance, authorization, and API approval coverage.
Reviewed against issue #5860, docs/platform-health.md, and the linked ServicePulse models/store. No private context was provided.
| File | Description |
|---|---|
src/ServiceControl/ServiceControlApiHostBuilderExtensions.cs |
Registers license information provider. |
src/ServiceControl/PlatformHealth/PlatformHealthState.cs |
Tracks internal health-check state. |
src/ServiceControl/PlatformHealth/PlatformHealthController.cs |
Exposes the health endpoint. |
src/ServiceControl/PlatformHealth/PlatformHealthApi.cs |
Builds platform health responses. |
src/ServiceControl/PlatformHealth.http |
Adds manual API requests. |
src/ServiceControl/Licensing/LicenseInfoProvider.cs |
Extracts shared license mapping. |
src/ServiceControl/Licensing/LicenseController.cs |
Uses the shared provider. |
src/ServiceControl/Infrastructure/WebApi/RemoteInstanceServiceCollectionExtensions.cs |
Preserves remote URL prefixes. |
src/ServiceControl/Infrastructure/Api/ConfigurationApi.cs |
Adds discovery metadata and robust remote probing. |
src/ServiceControl/CustomChecks/CustomChecksComponent.cs |
Registers platform health services. |
src/ServiceControl/CustomChecks/CustomCheckResultProcessor.cs |
Records internal health reports. |
src/ServiceControl.UnitTests/ScatterGather/RemoteInstanceHttpClientTests.cs |
Tests remote configuration requests. |
src/ServiceControl.UnitTests/PlatformHealth/PlatformHealthStateTests.cs |
Tests health-state behavior. |
src/ServiceControl.UnitTests/PlatformHealth/PlatformHealthApiTests.cs |
Tests response assembly and failures. |
src/ServiceControl.UnitTests/Licensing/ActiveLicenseTests.cs |
Tests extracted license mapping. |
src/ServiceControl.UnitTests/ApprovalFiles/APIApprovals.RootPathValue.approved.txt |
Approves discovery URL addition. |
src/ServiceControl.UnitTests/ApprovalFiles/APIApprovals.HttpApiRoutes.approved.txt |
Approves the new route. |
src/ServiceControl.UnitTests/API/APIApprovals.cs |
Tests primary configuration metadata. |
src/ServiceControl.MultiInstance.AcceptanceTests/Infrastructure/When_inspecting_platform_health.cs |
Exercises multi-instance health behavior. |
src/ServiceControl.Audit/Infrastructure/WebApi/RootController.cs |
Publishes audit identity metadata. |
src/ServiceControl.Audit.UnitTests/API/APIApprovals.cs |
Tests audit configuration metadata. |
src/ServiceControl.Api/IPlatformHealthApi.cs |
Defines the health API abstraction. |
src/ServiceControl.Api/Contracts/RootUrls.cs |
Advertises platform health discovery. |
src/ServiceControl.Api/Contracts/PlatformHealthView.cs |
Defines response contracts. |
src/ServiceControl.AcceptanceTests/WebApi/When_the_configuration_page_is_read.cs |
Verifies configuration metadata. |
src/ServiceControl.AcceptanceTests/Security/OpenIdConnect/When_authentication_is_enabled.cs |
Verifies endpoint authorization. |
src/ServiceControl.AcceptanceTests/Monitoring/CustomChecks/When_custom_checks_are_classified.cs |
Verifies health/custom-check separation. |
docs/README.md |
Indexes the design documentation. |
docs/platform-health.md |
Documents the API contract and rationale. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| var hasConnector = connectorHeartbeatStatus.LastHeartbeat != null; | ||
| try | ||
| { | ||
| var license = await licenseInfoProvider.GetLicense(true, "servicepulse", cancellationToken); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.