pub struct HealthConfig {
pub path: String,
pub interval_ms: u64,
pub timeout_ms: u64,
pub healthy_threshold: u32,
pub unhealthy_threshold: u32,
pub port: Option<u16>,
}Expand description
Active-health-check policy (ADR 000017). A background prober issues GET {path} to each
instance every interval_ms — on the instance’s own traffic port, unless port names a
dedicated health-check port — and a 2xx within timeout_ms is a success, anything else
(non-2xx, timeout, connect error) a failure. unhealthy_threshold consecutive failures eject a
healthy instance from the rotation; healthy_threshold consecutive successes restore an ejected
one. Instances start pessimistic (unhealthy); the FIRST successful probe alone promotes a
never-yet-healthy instance (cold-start fast path), after which the full healthy_threshold
governs re-entry. Only path is required; the rest default. PartialEq lets a reload detect a
changed policy and re-probe the upstream’s instances from scratch (ADR 000017 reconcile).
Fields§
§path: StringThe probe request path, e.g. /healthz.
interval_ms: u64Probe period in milliseconds (default 2000).
timeout_ms: u64Per-probe timeout in milliseconds (default 1000).
healthy_threshold: u32Consecutive successes to restore an ejected instance (default 2). The first-ever promotion of a never-yet-healthy instance needs only one success, regardless of this value.
unhealthy_threshold: u32Consecutive failures to eject a healthy instance (default 3).
port: Option<u16>Dedicated port the probe connects to, distinct from the instance’s traffic port (e.g. a
separate metrics/health listener on the same host). None (default) probes the traffic port
itself, the pre-existing behaviour.
Trait Implementations§
Source§impl Clone for HealthConfig
impl Clone for HealthConfig
Source§fn clone(&self) -> HealthConfig
fn clone(&self) -> HealthConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HealthConfig
impl Debug for HealthConfig
Source§impl<'de> Deserialize<'de> for HealthConfig
impl<'de> Deserialize<'de> for HealthConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for HealthConfig
impl JsonSchema for HealthConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for HealthConfig
impl PartialEq for HealthConfig
Source§impl Serialize for HealthConfig
impl Serialize for HealthConfig
impl StructuralPartialEq for HealthConfig
Auto Trait Implementations§
impl Freeze for HealthConfig
impl RefUnwindSafe for HealthConfig
impl Send for HealthConfig
impl Sync for HealthConfig
impl Unpin for HealthConfig
impl UnsafeUnpin for HealthConfig
impl UnwindSafe for HealthConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more