aggregateStatus
SourceaggregateStatus(results: readonly HealthCheckResult[]) => HealthStatusExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
aggregateStatusaggregateStatus(results: readonly HealthCheckResult[]) => HealthStatusExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
autoRuntimeAdapterautoRuntimeAdapter() => RuntimeAdapterExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
createAbortSignalcreateAbortSignal(timeoutMs: number | undefined, parent?: AbortSignal) => { signal: AbortSignal; dispose: () => void; }Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
createHealthManagercreateHealthManager(options: HealthManagerOptions) => HealthManagerExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
defineHealthCheckdefineHealthCheck<TName extends string>(definition: HealthCheckDefinition<TName>) => HealthCheckDefinition<TName>Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
defineMetricCollectordefineMetricCollector<TName extends string>(definition: MetricCollectorDefinition<TName>) => MetricCollectorDefinition<TName>Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
genericRuntimeAdaptergenericRuntimeAdapter() => RuntimeAdapterExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
httpCheckhttpCheck(name: string, url: string | URL, options?: HttpCheckOptions) => HealthCheckDefinition<string>Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
memoryCheckmemoryCheck(options?: { scopes?: readonly HealthScope[]; availableRatio?: { degraded: number; unhealthy: number; }; usedRatio?: { degraded: number; unhealthy: number; }; critical?: boolean | Partial<Record<HealthScope, boolean>>; }) => HealthCheckDefinition<"memory">Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
runtimeInfoCheckruntimeInfoCheck(options?: { scopes?: readonly HealthScope[]; critical?: boolean; }) => HealthCheckDefinition<"runtime.info">Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
runtimeMetricsCollectorruntimeMetricsCollector(options?: { scopes?: readonly HealthScope[]; }) => MetricCollectorDefinition<"runtime.metrics">Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
shutdownCheckshutdownCheck(options?: { scopes?: readonly HealthScope[]; }) => HealthCheckDefinition<"shutdown">Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
sleepsleep(ms: number, signal?: AbortSignal) => Promise<void>Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
startupCheckstartupCheck(options: { isStarted: () => boolean | Promise<boolean>; scopes?: readonly HealthScope[]; timeoutMs?: number; }) => HealthCheckDefinition<"startup">Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
statusToHttpStatusstatusToHttpStatus(status: HealthStatus, policy?: HealthHttpStatusPolicy) => numberExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
stringifyHealthJsonstringifyHealthJson(report: HealthReport, options?: HealthJsonOptions) => stringExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
summarizeCheckssummarizeChecks(results: readonly HealthCheckResult[]) => HealthSummaryExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
timerLagChecktimerLagCheck(options?: { scopes?: readonly HealthScope[]; sampleMs?: number; thresholds?: { degradedMs: number; unhealthyMs: number; }; critical?: boolean; }) => HealthCheckDefinition<"timer.lag">Exported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
toHealthJsontoHealthJson(report: HealthReport, options?: HealthJsonOptions) => HealthReportExported from: @nexload-sdk/healthcheck
Public function exported by @nexload-sdk/healthcheck.
DEFAULT_HTTP_STATUS_POLICYDEFAULT_HTTP_STATUS_POLICY: HealthHttpStatusPolicyExported from: @nexload-sdk/healthcheck
Public constant exported by @nexload-sdk/healthcheck.
HEALTH_ERROR_CODESHEALTH_ERROR_CODES: { readonly CHECK_THROWN: "CHECK_THROWN"; readonly CHECK_TIMEOUT: "CHECK_TIMEOUT"; readonly CHECK_ABORTED: "CHECK_ABORTED"; readonly HEALTHCHECK_TIMEOUT: "HEALTHCHECK_TIMEOUT"; readonly HEALTHCHECK_ABORTED: "HEALTHCHECK_ABORTED"; readonly HEALTHCHECK_DEPENDENCY_UNAVAILABLE: "HEALTHCHECK_DEPENDENCY_UNAVAILABLE"; readonly HEALTHCHECK_CONTAINER_LIMIT_UNAVAILABLE: "HEALTHCHECK_CONTAINER_LIMIT_UNAVAILABLE"; readonly HEALTHCHECK_ROUTE_UNAUTHORIZED: "HEALTHCHECK_ROUTE_UNAUTHORIZED"; readonly HEALTHCHECK_INVALID_CONFIG: "HEALTHCHECK_INVALID_CONFIG"; readonly HTTP_STATUS_MISMATCH: "HTTP_STATUS_MISMATCH"; readonly HTTP_BODY_MISMATCH: "HTTP_BODY_MISMATCH"; readonly TCP_CONNECT_FAILED: "TCP_CONNECT_FAILED"; readonly DNS_RESOLVE_FAILED: "DNS_RESOLVE_FAILED"; readonly DATABASE_PING_FAILED: "DATABASE_PING_FAILED"; readonly PAYLOAD_QUERY_FAILED: "PAYLOAD_QUERY_FAILED"; readonly RUNTIME_UNSUPPORTED: "RUNTIME_UNSUPPORTED"; readonly METRIC_UNAVAILABLE: "METRIC_UNAVAILABLE"; }Exported from: @nexload-sdk/healthcheck
Public constant exported by @nexload-sdk/healthcheck.
STRICT_READINESS_HTTP_STATUS_POLICYSTRICT_READINESS_HTTP_STATUS_POLICY: HealthHttpStatusPolicyExported from: @nexload-sdk/healthcheck
Public constant exported by @nexload-sdk/healthcheck.
EnvironmentIdentityinterface EnvironmentIdentity {
name?: string
region?: string
zone?: string
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthCheckDefinitioninterface HealthCheckDefinition<TName extends string = string> {
kind?: "check"
name: TName
component?: string
scopes: readonly HealthScope[]
critical?: boolean | Partial<Record<HealthScope, boolean>>
timeoutMs?: number
retries?: RetryPolicy
tags?: readonly string[]
run(context: HealthRunContext): Promise<HealthCheckRunResult> | HealthCheckRunResult
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthCheckResultinterface HealthCheckResult<TName extends string = string> {
name: TName
component?: string
scope: HealthRunScope
status: HealthStatus
critical: boolean
observedAt: string
durationMs: number
timedOut: boolean
attempt: number
metrics: HealthMetrics
details?: HealthDetails
error?: HealthErrorInfo
tags?: readonly string[]
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthCheckRunResultinterface HealthCheckRunResult {
status: HealthStatus
metrics?: HealthMetrics
details?: HealthDetails
error?: HealthErrorInfo
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthErrorInfointerface HealthErrorInfo {
code: string
message: string
causeName?: string
causeMessage?: string
stack?: string
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthHttpStatusPolicyinterface HealthHttpStatusPolicy {
ok: number
degraded: number
unhealthy: number
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthJsonOptionsinterface HealthJsonOptions {
includeDetails?: boolean
redact?: boolean
redaction?: Partial<RedactionPolicy>
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthLinksinterface HealthLinks {
self?: string
metrics?: string
diagnostics?: string
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthManagerinterface HealthManager {
register(check: HealthCheckDefinition): HealthManager
registerCollector(collector: MetricCollectorDefinition): HealthManager
unregister(name: string): boolean
run(scope: HealthRunScope, options?: HealthRunOptions): Promise<HealthReport>
setShutdownState(state: boolean, reason?: string): void
isShuttingDown(): boolean
dispose(): void
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthManagerOptionsinterface HealthManagerOptions {
service: ServiceIdentity
runtime?: RuntimeAdapter | "auto"
environment?: EnvironmentIdentity
defaults?: {
timeoutMs?: number
concurrency?: number
/** Defaults to true. Set false to report timed-out checks as degraded. */
unhealthyOnTimeout?: boolean
includeStack?: boolean
profile?: HealthDataProfile
}
/** Profiles are passed to checks and collectors as context hints. */
profiles?: Partial<Record<HealthScope, HealthDataProfile>> & { default?: HealthDataProfile }
/** @deprecated Configure redaction when calling toHealthJson or stringifyHealthJson. */
redaction?: Partial<RedactionPolicy>
checks?: readonly HealthCheckDefinition[]
collectors?: readonly MetricCollectorDefinition[]
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthMetricinterface HealthMetric {
name: string
value: HealthMetricValue
unit?:
| "bytes"
| "seconds"
| "milliseconds"
| "ratio"
| "count"
| "percent"
| "state"
type?: "gauge" | "counter" | "histogram" | "info"
labels?: Record<string, string>
description?: string
observedAt?: string
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthReportinterface HealthReport {
schemaVersion: "2.0"
service: ServiceIdentity
scope: HealthRunScope
status: HealthStatus
observedAt: string
durationMs: number
runtime: RuntimeIdentity
environment?: EnvironmentIdentity
summary: HealthSummary
checks: readonly HealthCheckResult[]
metrics: readonly HealthMetric[]
resources?: Record<string, unknown>
links?: HealthLinks
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthRunContextinterface HealthRunContext {
scope: HealthRunScope
signal: AbortSignal
runtime: RuntimeAdapter
service: ServiceIdentity
profile: HealthDataProfile
now: () => number
getShutdownState: () => { shuttingDown: boolean, reason?: string }
result: (result: HealthCheckRunResult) => HealthCheckRunResult
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthRunOptionsinterface HealthRunOptions {
signal?: AbortSignal
profile?: HealthDataProfile
/** @deprecated Select a profile and configure serializer detail options instead. */
includeDiagnostics?: boolean
includeStacks?: boolean
timeoutMs?: number
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthSummaryinterface HealthSummary {
ok: number
degraded: number
unhealthy: number
total: number
criticalFailed: number
nonCriticalFailed: number
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HttpCheckOptionsinterface HttpCheckOptions {
scopes?: readonly HealthScope[]
method?: "GET" | "HEAD" | "POST"
headers?: HeadersInit
body?: BodyInit | null
expectedStatus?: number | readonly number[] | { min: number, max: number }
validateBody?: (body: string, response: Response) => boolean | Promise<boolean>
timeoutMs?: number
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
MetricCollectionResultinterface MetricCollectionResult {
metrics: readonly HealthMetric[]
resources?: Record<string, unknown>
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
MetricCollectorDefinitioninterface MetricCollectorDefinition<TName extends string = string> {
kind?: "collector"
name: TName
scopes?: readonly HealthScope[]
defaultEnabled?: boolean
timeoutMs?: number
collect(context: HealthRunContext): Promise<MetricCollectionResult> | MetricCollectionResult
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
RedactionPolicyinterface RedactionPolicy {
redactSecrets: boolean
redactUrls: "none" | "query" | "origin" | "full"
includeStack: boolean
includeErrorMessage: boolean
allowedDetailKeys?: readonly string[]
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
RetryPolicyinterface RetryPolicy {
attempts: number
delayMs?: number
backoff?: "none" | "linear" | "exponential"
retryOn?: readonly HealthStatus[]
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
RuntimeAdapterinterface RuntimeAdapter {
name: RuntimeIdentity["name"]
now(): number
uptimeSeconds(): number | null
getRuntimeInfo(): RuntimeIdentity
getMemory?(): RuntimeMemorySnapshot | Promise<RuntimeMemorySnapshot>
getCpu?(previous?: RuntimeCpuSnapshot): RuntimeCpuSnapshot | Promise<RuntimeCpuSnapshot>
onShutdown?(signals: readonly string[], callback: (signal: string) => void): () => void
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
RuntimeCpuSnapshotinterface RuntimeCpuSnapshot {
userMicros: number | null
systemMicros: number | null
availableParallelism: number | null
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
RuntimeIdentityinterface RuntimeIdentity {
name: "node" | "bun" | "unknown"
version?: string
revision?: string
platform?: string
arch?: string
pid?: number
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
RuntimeMemorySnapshotinterface RuntimeMemorySnapshot {
rssBytes: number | null
heapTotalBytes: number | null
heapUsedBytes: number | null
externalBytes: number | null
arrayBuffersBytes: number | null
constrainedBytes: number | null
availableBytes: number | null
totalBytes: number | null
usedRatio: number | null
availableRatio: number | null
source: string
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
ServiceIdentityinterface ServiceIdentity {
name: string
version?: string
environment?: string
instanceId?: string
}Exported from: @nexload-sdk/healthcheck
Public interface exported by @nexload-sdk/healthcheck.
HealthDataProfiletype HealthDataProfile
= | "probe"
| "summary"
| "monitoring"
| "diagnostics"
| "full";Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
HealthDetailstype HealthDetails = Record<string, unknown>;Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
HealthErrorCodetype HealthErrorCode
= (typeof HEALTH_ERROR_CODES)[keyof typeof HEALTH_ERROR_CODES];Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
HealthMetricValuetype HealthMetricValue = string | number | boolean | null;Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
HealthMetricstype HealthMetrics = Record<string, HealthMetricValue>;Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
HealthRunScopetype HealthRunScope = HealthScope | "all";Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
HealthScopetype HealthScope
= | "liveness"
| "readiness"
| "startup"
| "diagnostics";Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
HealthStatustype HealthStatus = "ok" | "degraded" | "unhealthy";Exported from: @nexload-sdk/healthcheck
Public type exported by @nexload-sdk/healthcheck.
createHealthManager(options) creates a manager with run, shutdown-state, and registration operations.defineHealthCheck() and defineMetricCollector() preserve typed definitions.runtimeInfoCheck, shutdownCheck, startupCheck, timerLagCheck, memoryCheck, and httpCheck create built-in checks.runtimeMetricsCollector() produces report-level runtime metrics.toHealthJson() and stringifyHealthJson() serialize reports with detail and redaction controls.aggregateStatus() and summarizeChecks() operate on completed results.statusToHttpStatus() applies DEFAULT_HTTP_STATUS_POLICY or STRICT_READINESS_HTTP_STATUS_POLICY.genericRuntimeAdapter() and autoRuntimeAdapter() avoid importing a runtime integration.createAbortSignal() and sleep() support cancellation-aware checks.HEALTH_ERROR_CODES is the stable error-code vocabulary. Public types include manager, report, check, collector, runtime, retry, redaction, metric, HTTP-policy, and serialization contracts.