Public API for health checking system. Provides a simple interface for managing health-aware load balancing.
Public API for health checking system. Provides a simple interface for managing health-aware load balancing.
(all-healthy? proxy-name)Check if all targets for a proxy are healthy.
Check if all targets for a proxy are healthy.
(check-http ip port path)(check-http ip port path timeout-ms)(check-http ip port path timeout-ms expected-codes)Perform a one-off HTTP health check. Returns CheckResult with :success?, :latency-ms, :error, :message.
Perform a one-off HTTP health check. Returns CheckResult with :success?, :latency-ms, :error, :message.
(check-https ip port path)(check-https ip port path timeout-ms)(check-https ip port path timeout-ms expected-codes)Perform a one-off HTTPS health check. Returns CheckResult with :success?, :latency-ms, :error, :message.
Perform a one-off HTTPS health check. Returns CheckResult with :success?, :latency-ms, :error, :message.
(check-tcp ip port timeout-ms)Perform a one-off TCP health check. Returns CheckResult with :success?, :latency-ms, :error, :message.
Perform a one-off TCP health check. Returns CheckResult with :success?, :latency-ms, :error, :message.
(force-check! proxy-name target-id)Force an immediate health check for a target. The check runs asynchronously.
Force an immediate health check for a target. The check runs asynchronously.
(format-status proxy-name)Format health status for display.
Format health status for display.
(get-all-status)Get health status for all registered proxies.
Get health status for all registered proxies.
(get-status proxy-name)Get health status for a specific proxy.
Returns: {:proxy-name "name" :targets [{:target-id "ip:port" :ip "10.0.0.1" :port 8080 :status :healthy/:unhealthy/:unknown :consecutive-successes 3 :consecutive-failures 0 :last-check-time 1234567890 :last-latency-ms 5.2 :last-error nil}] :original-weights [50 30 20] :effective-weights [71 0 29] :last-update-time 1234567890}
Get health status for a specific proxy.
Returns:
{:proxy-name "name"
:targets [{:target-id "ip:port"
:ip "10.0.0.1"
:port 8080
:status :healthy/:unhealthy/:unknown
:consecutive-successes 3
:consecutive-failures 0
:last-check-time 1234567890
:last-latency-ms 5.2
:last-error nil}]
:original-weights [50 30 20]
:effective-weights [71 0 29]
:last-update-time 1234567890}(get-target-status proxy-name target-id)Get health status for a specific target. Returns :healthy, :unhealthy, :unknown, or nil if target not found.
Get health status for a specific target. Returns :healthy, :unhealthy, :unknown, or nil if target not found.
(healthy? proxy-name target-id)Check if a specific target is healthy.
Check if a specific target is healthy.
(print-all-status)Print health status for all proxies.
Print health status for all proxies.
(print-status proxy-name)Print health status for a proxy.
Print health status for a proxy.
(register-proxy! proxy-name target-group settings update-fn)Register a proxy for health checking.
Arguments: proxy-name: Unique name for the proxy target-group: TargetGroup containing targets to monitor settings: Settings record with health-check-defaults update-fn: Function called when weights change (receives new TargetGroup)
The update-fn is called with a new TargetGroup that has updated cumulative-weights based on target health. Use this to update BPF maps.
Register a proxy for health checking. Arguments: proxy-name: Unique name for the proxy target-group: TargetGroup containing targets to monitor settings: Settings record with health-check-defaults update-fn: Function called when weights change (receives new TargetGroup) The update-fn is called with a new TargetGroup that has updated cumulative-weights based on target health. Use this to update BPF maps.
(running?)Check if the health checking system is running.
Check if the health checking system is running.
(set-target-status! proxy-name target-id status)Manually set a target's health status. Useful for maintenance windows or testing.
status should be :healthy, :unhealthy, or :unknown
Manually set a target's health status. Useful for maintenance windows or testing. status should be :healthy, :unhealthy, or :unknown
(start!)Start the health checking system. Must be called before registering proxies for health monitoring.
Start the health checking system. Must be called before registering proxies for health monitoring.
(stop!)Stop the health checking system. Stops all health checks and clears registered proxies.
Stop the health checking system. Stops all health checks and clears registered proxies.
(subscribe! callback)Subscribe to health events.
Callback receives HealthEvent maps: {:type :target-healthy/:target-unhealthy/:weights-updated :proxy-name "name" :target-id "ip:port" (nil for :weights-updated) :timestamp epoch-ms :details {...}}
Returns an unsubscribe function.
Subscribe to health events.
Callback receives HealthEvent maps:
{:type :target-healthy/:target-unhealthy/:weights-updated
:proxy-name "name"
:target-id "ip:port" (nil for :weights-updated)
:timestamp epoch-ms
:details {...}}
Returns an unsubscribe function.(target-id ip port)Create a target ID string from IP and port.
Create a target ID string from IP and port.
(unhealthy-targets proxy-name)Get list of unhealthy targets for a proxy.
Get list of unhealthy targets for a proxy.
(unregister-proxy! proxy-name)Unregister a proxy from health checking.
Unregister a proxy from health checking.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |