interface IHealthIndicator
Since 0.1.0

A named health indicator contributing to /health, /live, and /ready.

Examples

Example 1

const dbIndicator: IHealthIndicator = {
  name: 'database',
  async check() {
    const healthy = await db.ping();
    return { status: healthy ? 'up' : 'down' };
  },
};

Properties

readonly
name: string

Indicator name, unique per application.

Methods

check(): Promise<HealthCheckResult>

Performs the health check.

Usage

import { type IHealthIndicator } from "health-plugin/src/index.ts";