fix: disclose node-specific health probes
This commit is contained in:
@@ -742,7 +742,7 @@ export function withNodeRuntimeControlPlaneStatusRendered(result: Record<string,
|
||||
const publicProbe = record(result.publicProbe);
|
||||
const gitMirror = record(result.gitMirror);
|
||||
const next = record(result.next);
|
||||
const diagnostic = record(publicProbe.diagnostic);
|
||||
const publicProbeDetail = nodeRuntimePublicProbeDetail(publicProbe);
|
||||
const notReadyWorkloads = Array.isArray(runtime.notReadyWorkloads) ? runtime.notReadyWorkloads.map((item) => webObserveText(item)).filter(Boolean) : [];
|
||||
const runtimeDetail = [
|
||||
`workloads=${webObserveText(runtime.workloadReady)}`,
|
||||
@@ -781,7 +781,7 @@ export function withNodeRuntimeControlPlaneStatusRendered(result: Record<string,
|
||||
["pipeline", pipelineRun.ready === true ? "ok" : pipelineRun.exists === true ? webObserveText(pipelineRun.status) : "missing", pipelineDetail],
|
||||
["argo", argo.ready === true ? "ok" : "failed", `${webObserveText(argo.syncStatus)}/${webObserveText(argo.health)} rev=${shortValue(argo.syncRevision)} target=${shortValue(argo.targetGitopsRevision)} op=${webObserveText(argoOperation.phase)}`],
|
||||
["runtime", runtime.ready === true ? "ok" : "failed", runtimeDetail],
|
||||
["public", publicProbe.ready === true ? "ok" : "failed", webObserveShort(webObserveText(diagnostic.kind ?? diagnostic.message), 80)],
|
||||
["public", publicProbe.ready === true ? "ok" : "failed", publicProbeDetail],
|
||||
["git-mirror", gitMirror.ready === true ? "ok" : "failed", `snapshot=${webObserveText(gitMirror.sourceSnapshotReady)} pending=${webObserveText(gitMirror.pendingFlush)} inSync=${webObserveText(gitMirror.githubInSync)}`],
|
||||
],
|
||||
),
|
||||
@@ -824,6 +824,7 @@ export function withNodeRuntimeControlPlaneStatusFullRendered(result: Record<str
|
||||
const argoEvents = arrayRecords(argoDiagnostics.events);
|
||||
const runtimeSummary = record(summary.runtime);
|
||||
const publicProbe = record(summary.publicProbe);
|
||||
const publicProbeDetail = nodeRuntimePublicProbeDetail(publicProbe);
|
||||
const gitMirror = record(summary.gitMirror);
|
||||
const runtime = record(result.runtime);
|
||||
const bridge = record(runtime.externalPostgresBridge);
|
||||
@@ -875,7 +876,7 @@ export function withNodeRuntimeControlPlaneStatusFullRendered(result: Record<str
|
||||
["pipeline", pipelineRun.ready === true ? "ok" : pipelineRun.exists === true ? webObserveText(pipelineRun.status) : "missing", webObserveShort(webObserveText(pipelineRun.reason ?? pipelineRun.message), 80)],
|
||||
["argo", argo.ready === true ? "ok" : "failed", `${webObserveText(argo.syncStatus)}/${webObserveText(argo.health)} rev=${shortValue(argo.syncRevision)} target=${shortValue(argo.targetGitopsRevision)}`],
|
||||
["runtime", runtimeSummary.ready === true ? "ok" : "failed", `namespace=${webObserveText(runtimeSummary.namespace)} workloads=${webObserveText(runtimeSummary.workloadReady)} pg=${webObserveText(runtimeSummary.externalPostgresReady ?? runtimeSummary.localPostgresReady)}`],
|
||||
["public", publicProbe.ready === true ? "ok" : "failed", webObserveShort(webObserveText(record(publicProbe.diagnostic).kind ?? record(publicProbe.diagnostic).message), 80)],
|
||||
["public", publicProbe.ready === true ? "ok" : "failed", publicProbeDetail],
|
||||
["git-mirror", gitMirror.ready === true ? "ok" : "failed", `pending=${webObserveText(gitMirror.pendingFlush)} inSync=${webObserveText(gitMirror.githubInSync)}`],
|
||||
],
|
||||
),
|
||||
@@ -970,6 +971,17 @@ export function withNodeRuntimeControlPlaneStatusFullRendered(result: Record<str
|
||||
return { ...result, renderedText, contentType: "text/plain" };
|
||||
}
|
||||
|
||||
function nodeRuntimePublicProbeDetail(publicProbe: Record<string, unknown>): string {
|
||||
const web = record(publicProbe.web);
|
||||
const apiHealth = record(publicProbe.apiHealth);
|
||||
const diagnostic = record(publicProbe.diagnostic);
|
||||
return [
|
||||
`web=${webObserveShort(webObserveText(web.url), 80)}(${webObserveText(web.httpStatus)})`,
|
||||
`api=${webObserveShort(webObserveText(apiHealth.url), 80)}(${webObserveText(apiHealth.httpStatus)})`,
|
||||
webObserveShort(webObserveText(diagnostic.kind ?? diagnostic.message), 80),
|
||||
].filter((item) => item !== "-").join(" ");
|
||||
}
|
||||
|
||||
function arrayRecords(value: unknown): Record<string, unknown>[] {
|
||||
return Array.isArray(value)
|
||||
? value.filter((item): item is Record<string, unknown> => typeof item === "object" && item !== null && !Array.isArray(item))
|
||||
|
||||
Reference in New Issue
Block a user