4. Monitoring, Logging and Statistics

balancerHealthMonitor

Version

Health monitor for a {@link LoadBalancingInterceptor} {@link Cluster}. Periodically checks the health of all clusters registered on the router and updates each {@link Node}'s status accordingly. When initialized, it schedules a task to call each {@link Node}'s health endpoint and marks nodes as {@link Status#UP} or {@link Status#DOWN} based on the result: If a health URL is configured for the node, it performs an HTTP request against that endpoint. Otherwise, it performs a TCP check against the node's host and port. This ensures the load balancer always has up-to-date status for routing decisions.

Example:

health monitor example

Syntax

balancerHealthMonitor:
'$ref': <string>
httpClientConfig: {}
interval: <number>
balancerHealthMonitor:
  '$ref': <string>
  httpClientConfig: {}
  interval: <number>

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
intervalfalse10000Sets the health check interval (in milliseconds).30000

Child Structure

ElementCardinalityDescription
httpClientConfig0..1Optional HTTP client configuration for health probes (e.g., timeouts, TLS). If provided, it is used when creating the {@link HttpClient} via the router's client factory.

Can be used in