---
title: "Health Checks"
description: "Configure automated health monitoring and failover for high availability"
---
Health checks are only available for targets created with managed self-hosted nodes or in the cloud.
## Overview
Pangolin provides automated health checking for [targets](./resources/targets.mdx) to ensure traffic is only routed to healthy services. When you create targets with managed nodes or in the cloud, you can optionally define health check parameters to monitor the availability and responsiveness of your services.
Health checks are essential for building highly available services, as they automatically remove unhealthy targets from traffic routing and load balancing.
## How Health Checks Work
### Monitoring Process
Health checks operate continuously in the background:
1. **Periodic Checks**: Pangolin sends requests to your target endpoints at configured intervals
2. **Status Evaluation**: Responses are evaluated against your configured criteria
3. **Traffic Management**: Healthy targets receive traffic, unhealthy targets are excluded
4. **Automatic Recovery**: Targets are automatically re-enabled when they become healthy again
### Health Check vs Target Endpoint
The health check endpoint can be the same as your target, but you can also monitor a different endpoint. This allows you to create dedicated health check endpoints that provide more detailed service status information.
## Target Health States
Targets can exist in three distinct states that determine how traffic is routed:
**Initial State**: Targets start in this state before first health check
**Traffic Behavior**: Unknown targets still route traffic normally
**Duration**: Until first health check completes
**Failed Checks**: Target has failed health check criteria
**Traffic Behavior**: No traffic is routed to unhealthy targets
**Load Balancing**: Excluded from load balancing rotation
**Passing Checks**: Target is responding correctly to health checks
**Traffic Behavior**: Receives traffic according to load balancing rules
**Load Balancing**: Included in load balancing rotation
## Configuring Health Checks
In the Pangolin dashboard, navigate to your resource and locate the target in the table.
Click the settings wheel (⚙️) next to the health check endpoint column.
Fill out the health check configuration with your desired parameters.
Save your settings to enable health checking for the target.
## Health Check Parameters
### Endpoint Configuration
**Target Endpoint**: The URL or address to monitor for health status
**Default Behavior**: Usually the same as your target endpoint
**Custom Endpoints**: Can monitor different endpoints (e.g., `/health`, `/status`)
### Timing Configuration
**Purpose**: How often to check targets that are currently healthy
**Typical Range**: 30-60 seconds
**Consideration**: Less frequent checks reduce overhead
**Purpose**: How often to check targets that are currently unhealthy
**Typical Range**: 10-30 seconds
**Consideration**: More frequent checks enable faster recovery
### Response Configuration
**Request Timeout**: Maximum time to wait for a health check response
**Default Behavior**: Requests exceeding timeout are considered failed
**Recommended**: Set based on your service's typical response time
**Healthy Codes**: Which HTTP status codes indicate a healthy target
**Common Settings**: 200, 201, 202, 204
**Custom Codes**: Configure based on your service's health endpoint behavior
## Failover Behavior
### Automatic Traffic Exclusion
When a target becomes unhealthy:
Target fails to meet health check criteria (response code, timeout, etc.)
Target status changes from "Healthy" to "Unhealthy"
Target is immediately removed from traffic routing configuration
Load balancing configuration is updated to exclude the unhealthy target
Health checks continue at the unhealthy interval for recovery detection
### Automatic Recovery
When an unhealthy target recovers:
Target begins responding correctly to health checks
Target status changes from "Unhealthy" to "Healthy"
Target is automatically added back to traffic routing
Load balancing resumes including the recovered target
## High Availability Strategies
### Multi-Target Redundancy
Deploy multiple instances of your service across different targets to ensure availability even when some targets fail.
```
Resource: web-application
├── Target 1: web-01.local:8080 (Site A) - Healthy ✅
├── Target 2: web-02.local:8080 (Site A) - Unhealthy ❌
└── Target 3: web-03.local:8080 (Site B) - Healthy ✅
Traffic routes to: Target 1 & Target 3 only
```
### Cross-Site Failover
Distribute targets across multiple sites to protect against site-level failures.
```
Resource: api-service
├── Primary Site Targets
│ ├── api-01.primary:8443 - Healthy ✅
│ └── api-02.primary:8443 - Healthy ✅
└── Backup Site Targets
├── api-01.backup:8443 - Healthy ✅
└── api-02.backup:8443 - Healthy ✅
All targets receive traffic via load balancing
```