Skip to content
reaatechREAATECH

@reaatech/agent-runbook-health-checks

npm v0.1.0

Analyzes codebases to identify existing health check patterns and generates Kubernetes probe YAML, load balancer configurations, and endpoint implementations. It provides a set of utility functions for automating the creation of service health definitions based on provided analysis contexts.

@reaatech/agent-runbook-health-checks

npm version License: MIT CI

Health check generation for the Agent Runbook Generator. Identifies existing health checks and generates liveness, readiness, and startup probe definitions for Kubernetes and load balancers.

Installation

terminal
npm install @reaatech/agent-runbook-health-checks
# or
pnpm add @reaatech/agent-runbook-health-checks

Feature Overview

  • Check identification — finds existing health check endpoints and patterns in the codebase
  • Service-type suggestions — suggests appropriate health checks based on detected service type
  • Kubernetes probes — generates liveness, readiness, and startup probe YAML
  • Load balancer configs — generates target group health check configuration
  • Endpoint generation — generates health check endpoint implementations in the target language

Quick Start

typescript
import { identifyHealthChecks, generateHealthChecks, generateKubernetesProbeYaml } from "@reaatech/agent-runbook-health-checks";
 
const existing = identifyHealthChecks("/path/to/repo", analysisContext);
 
const checks = generateHealthChecks("/path/to/repo", analysisContext, {
  platform: "kubernetes",
  serviceName: "my-api",
  port: 3000,
});
 
console.log(generateKubernetesProbeYaml(checks, "my-container", 3000));

API Reference

Check Identifier

FunctionSignature
identifyHealthChecks(repoPath: string, context: AnalysisContext) => HealthCheck[]
suggestHealthChecks(serviceType: string) => HealthCheck[]

Check Generator

FunctionSignature
generateHealthChecks(repoPath: string, context: AnalysisContext, config: HealthCheckConfig) => HealthCheck[]
generateKubernetesProbeYaml(checks: HealthCheck[], containerName?: string, port?: number) => string
generateLoadBalancerConfig(checks: HealthCheck[]) => string
generateHealthCheckEndpoint(checks: HealthCheck[], language: string) => string

HealthCheckConfig: { platform: string; serviceName: string; port?: number; path?: string }

License

MIT