Health Checks

Health checks are vital for ensuring the reliability and availability of your application.

In Binacle.Net, health checks offer a structured way to monitor system health and integrate seamlessly with external monitoring tools. Enabling health checks helps you to:

๐Ÿ› ๏ธ Configuration

Health checks are configured via the HealthChecks.json file.

Default configuration:

{
  "HealthChecks": {
    "Enabled": false,
    "Path": "/_health",
    "RestrictedIPs": [],
    "RestrictedChecks": []
  }
}

You can modify the health check settings through Production Overrides by creating a HealthChecks.Production.json file, or by using Environment Variables.

For more information on overriding configurations, refer to the Configuration Basics page.

๐Ÿ”ง Configuration Options

๐Ÿ”’ Restricting Access

By default, health checks are publicly accessible. However, you can restrict access by specifying allowed IPs or subnets in the RestrictedIPs array:

{
  "RestrictedIPs": [
    "192.168.1.1",                // Single IP
    "192.168.1.0-192.168.1.255",  // IP Range
    "192.168.1.0/24",             // CIDR notation 
    "10.0.0.0/8"                  // Larger subnet range
  ]
}

This ensures that only authorized systems can query the health check endpoint.

๐Ÿ› ๏ธ Built-in Checks

Binacle.Net comes with built-in health checks, including:

You can disable specific health checks by listing them in the RestrictedChecks array. For example, to disable the Database Check, you can configure it like this:

{
  "RestrictedChecks": [
    "Database"
  ]  
}

This feature is useful if you cannot restrict access using RestrictedIPs but still want to limit exposure to sensitive system details.