HealthConfig class

Configuration for the health check system.

Use this to customize caching behavior and register custom health indicators.

Example:

final pod = Serverpod(
  args,
  Protocol(),
  Endpoints(),
  healthConfig: HealthConfig(
    cacheTtl: Duration(seconds: 2),
    additionalReadinessIndicators: [
      StripeApiIndicator(),
      InventoryServiceIndicator(),
    ],
  ),
);

Constructors

HealthConfig({Duration cacheTtl = const Duration(seconds: 1), List<HealthIndicator<Object>> additionalReadinessIndicators = const [], List<HealthIndicator<Object>> additionalStartupIndicators = const []})
Creates a health configuration.
const

Properties

additionalReadinessIndicators List<HealthIndicator<Object>>
Additional indicators to check for readiness (/readyz).
final
additionalStartupIndicators List<HealthIndicator<Object>>
Additional indicators to check for startup completion (/startupz).
final
cacheTtl Duration
How long to cache health check results.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited