StackPanel

healthchecks

Configuration options for stackpanel.healthchecks

Healthchecks Options

healthchecks.defaultInterval

Default interval for automatic healthcheck runs in seconds. Set to null to disable automatic checks.

PropertyValue
Typenull or signed integer
Default30

healthchecks.defaultTimeout

Default timeout for healthchecks in seconds

PropertyValue
Typesigned integer
Default10

healthchecks.enable

Enable the healthchecks system

PropertyValue
Typeboolean
Defaulttrue

healthchecks.modules

Healthchecks organized by module.

Each module can declare multiple healthchecks that verify its functionality. The UI displays a traffic light for each module based on the aggregate status of its healthchecks.

PropertyValue
Typeattribute set of (submodule)
Default{ }

Example:

{
  go = {
    displayName = "Go";
    checks = {
      # Inline script
      go-installed = {
        script = "command -v go >/dev/null 2>&1";
        severity = "critical";
      };
    };
  };

  postgres = {
    displayName = "PostgreSQL";
    checks = {
      # TCP check
      running = {
        type = "tcp";
        tcpHost = "localhost";
        tcpPort = 5432;
        severity = "critical";
      };
      # Path to script file
      has-tables = {
        path = ./.stack/src/checks/postgres/has-tables.sh;
        severity = "warning";
      };
    };
  };

  # Extension module
  sst = {
    displayName = "SST";
    checks = {
      configured = {
        path = ./src/checks/configured.sh;
        severity = "critical";
      };
    };
  };
}

healthchecks.modules.<name>.checks

Healthchecks for this module

PropertyValue
Typeattribute set of (submodule)
Default{ }

healthchecks.modules.<name>.checks.<name>.description

Description of what this check verifies

PropertyValue
Typenull or string
Defaultnull

healthchecks.modules.<name>.checks.<name>.enable

Whether this healthcheck is enabled

PropertyValue
Typeboolean
Defaulttrue

healthchecks.modules.<name>.checks.<name>.httpExpectedStatus

Expected HTTP status code for a healthy response

PropertyValue
Typesigned integer
Default200

healthchecks.modules.<name>.checks.<name>.httpMethod

HTTP method to use for http-type checks

PropertyValue
Typestring
Default"GET"

healthchecks.modules.<name>.checks.<name>.httpUrl

URL to check for http-type checks

PropertyValue
Typenull or string
Defaultnull

Example:

"http://localhost:3000/health"


healthchecks.modules.<name>.checks.<name>.interval

How often to run this check in seconds. If null, check runs only on demand.

PropertyValue
Typenull or signed integer
Defaultnull

healthchecks.modules.<name>.checks.<name>.name

Display name for the healthcheck

PropertyValue
Typestring
Default"‹name›"

healthchecks.modules.<name>.checks.<name>.nixExpr

Nix expression to evaluate for nix-type checks. Should evaluate to true for healthy, false for unhealthy.

PropertyValue
Typenull or string
Defaultnull

Example:

"builtins.pathExists /nix/store"


healthchecks.modules.<name>.checks.<name>.path

Path to script file for script-type checks. Content is read and used as the script body. Mutually exclusive with script and scriptRef.

PropertyValue
Typenull or absolute path
Defaultnull

Example:

./.stack/src/checks/postgres/can-connect.sh


healthchecks.modules.<name>.checks.<name>.script

Shell script content for script-type checks (inline). Should exit 0 for healthy, non-zero for unhealthy. Mutually exclusive with path and scriptRef.

PropertyValue
Typenull or string
Defaultnull

Example:

"command -v go >/dev/null 2>&1"


healthchecks.modules.<name>.checks.<name>.scriptPackage

A derivation that provides the healthcheck script. The script should be at $out/bin/ or $out.

PropertyValue
Typenull or package
Defaultnull

healthchecks.modules.<name>.checks.<name>.scriptRef

Reference to a stackpanel.scripts.* entry. The referenced script is used as the healthcheck command. Mutually exclusive with script and path.

PropertyValue
Typenull or string
Defaultnull

Example:

"db-connect"


healthchecks.modules.<name>.checks.<name>.severity

How critical this check is:

PropertyValue
Typeone of "critical", "warning", "info"
Default"warning"

healthchecks.modules.<name>.checks.<name>.tags

Tags for filtering/grouping checks

PropertyValue
Typelist of string
Default[ ]

Example:

[
  "database"
  "critical"
]

healthchecks.modules.<name>.checks.<name>.tcpHost

Host to connect to for tcp-type checks

PropertyValue
Typenull or string
Defaultnull

Example:

"localhost"


healthchecks.modules.<name>.checks.<name>.tcpPort

Port to connect to for tcp-type checks

PropertyValue
Typenull or signed integer
Defaultnull

Example:

5432


healthchecks.modules.<name>.checks.<name>.timeout

Timeout for the check in seconds

PropertyValue
Typesigned integer
Default10

healthchecks.modules.<name>.checks.<name>.type

Type of healthcheck (script, nix, http, tcp)

PropertyValue
Typeone of "script", "nix", "http", "tcp"
Default"script"

healthchecks.modules.<name>.displayName

Display name for the module in the UI

PropertyValue
Typestring
Default"‹name›"

healthchecks.modules.<name>.enable

Enable healthchecks for this module

PropertyValue
Typeboolean
Defaulttrue

healthchecksComputed

Computed healthcheck configurations (for agent API)

PropertyValue
Typeattribute set of attribute set of unspecified value
Default{ }
Read Onlytrue

healthchecksList

Flat list of all healthchecks (for agent API)

PropertyValue
Typelist of unspecified value
Default[ ]
Read Onlytrue

On this page