Ingot.HealthCheck (Ingot v0.1.0)

View Source

Health check module for Ingot.

Checks the health of:

  • The Phoenix endpoint (is the server running?)
  • Forge service (can we reach it?)
  • Anvil service (can we reach it?)

Used by the /health endpoint for monitoring and alerting.

Summary

Functions

Check if Anvil service is reachable.

Check if the Phoenix endpoint is running.

Check if Forge service is reachable.

Get detailed health status with per-service breakdowns.

Get overall health status.

Types

health_status()

@type health_status() :: :healthy | :unhealthy

Functions

check_anvil()

@spec check_anvil() :: :ok | :error

Check if Anvil service is reachable.

Returns :ok if Anvil responds to health check, :error otherwise.

check_endpoint()

@spec check_endpoint() :: :ok | :error

Check if the Phoenix endpoint is running.

Returns :ok if the endpoint is running, :error otherwise.

check_forge()

@spec check_forge() :: :ok | :error

Check if Forge service is reachable.

Returns :ok if Forge responds to health check, :error otherwise.

detailed_status()

@spec detailed_status() :: map()

Get detailed health status with per-service breakdowns.

Returns a map with overall status, individual service statuses, and timestamp.

status()

@spec status() :: health_status()

Get overall health status.

Returns :healthy if all services are reachable, :unhealthy otherwise.