Default implementation of IHealthService.
-
check(): Promise<HealthReport>
{@inheritDoc IHealthService.check}
-
checkLive(): Promise<HealthReport>
{@inheritDoc IHealthService.checkLive}
-
checkReady(): Promise<HealthReport>
{@inheritDoc IHealthService.checkReady}
-
registerIndicator(): voidname: string,indicator: HealthIndicatorFn
{@inheritDoc IHealthService.registerIndicator}
Creates an HTTP probe indicator.
Creates a health plugin.
The outcome of one health check.
-
data: Readonly<Record<string, unknown>>
Optional diagnostic details (response times, versions, …).
-
status: HealthStatus
The reported health state.
Options for configuring the health plugin.
-
endpoints: EndpointsOptions
Endpoint path configuration.
-
indicatorTimeoutMs: number
Deadline applied independently to every selected indicator, in milliseconds (M90b). Must be a positive finite number; anything else — zero, negative,
NaN,Infinity— throws at plugin construction. The identical check runs in the barrel-exportedHealthServiceconstructor, so constructing the service directly cannot bypass it. -
indicators: readonly HealthIndicatorEntry[]
Additional indicators to register.
The aggregated health report returned by IHealthService.check().
-
checks: Readonly<Record<string, Readonly<HealthCheckResult & { readonly latencyMs?: number; }>>>
Per-indicator results with optional latency measurements.
-
status: HealthStatus
Overall health status (worst of all participating indicators).
-
timestamp: string
ISO 8601 timestamp of when the check was performed.
Options for creating an HTTP probe indicator.
-
fetcher: fetch
Injectable fetcher for testing.
-
timeoutMs: number
Timeout in milliseconds for the request.
-
url: string
The URL to probe.
A named health indicator contributing to /health, /live, and
/ready.
-
check(): Promise<HealthCheckResult>
Performs the health check.
-
name: string
Indicator name, unique per application.
Health service contract for registering and checking health indicators.
-
check(): Promise<HealthReport>
Runs all registered indicators and returns the aggregated report.
-
checkLive(): Promise<HealthReport>
Runs only the liveness indicator (the built-in "self" indicator).
-
checkReady(): Promise<HealthReport>
Runs all contributed indicators for readiness.
-
registerIndicator(): voidname: string,indicator: HealthIndicatorFn
Registers a health indicator.
One entry of HealthPluginOptions.indicators: either a ready
indicator instance or a factory that builds one from the service registry.
Function form of a health indicator.
Health state reported by a health indicator.
Usage
import * as Health_check_plugin___health___live___ready_endpoints_with_pluggable_indicators___This_plugin_provides_____HealthPlugin____Main_plugin_factory_that_registers__IHealthService_____HealthService____Concrete_implementation_of_the_health_service____createHttpIndicator____Factory_for_HTTP_probe_indicators___Re_exports_of__IHealthService____IHealthIndicator____HealthCheckResult____HealthIndicatorFn____HealthStatus____HealthReport__from___setu_ts_common__ from "health-plugin/src/index.ts";