pub struct HealthConfig {
pub enabled: bool,
pub liveness: String,
pub readiness: String,
pub bind: Option<SocketAddr>,
pub max_connections: usize,
}Expand description
Health and readiness endpoints ([health] section), answered entirely
in Rust.
Two deliberately separate questions: liveness (“is the process alive?”)
never touches a Lua state; a probe that queued behind a saturated pool
would cause the restart it exists to prevent; and readiness (“should
it receive traffic?”) flips to 503 the moment a graceful drain
starts, so a rolling deploy shifts traffic before requests can fail.
An application cannot influence either answer.
Fields§
§enabled: boolWhether the endpoints are served at all.
liveness: StringLiveness path: 200 ok while the process runs.
readiness: StringReadiness path: 200 ok while accepting traffic, 503 draining
once a graceful shutdown begins.
bind: Option<SocketAddr>A separate address to serve the endpoints on, keeping them off the public port. When unset they answer on the main listener.
max_connections: usizeConnection cap for the separate probe listener (bind), deliberately
far below [limits] max_connections: a prober opens one connection,
not a thousand, and inheriting the main cap would let the probe port
consume the process’s whole file-descriptor budget on its own.
Ignored when the probes answer on the main listener, which has its
own cap.
Trait Implementations§
Source§impl Clone for HealthConfig
impl Clone for HealthConfig
Source§impl Debug for HealthConfig
impl Debug for HealthConfig
Source§impl Default for HealthConfig
impl Default for HealthConfig
Source§impl<'de> Deserialize<'de> for HealthConfigwhere
HealthConfig: Default,
impl<'de> Deserialize<'de> for HealthConfigwhere
HealthConfig: Default,
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>,
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> 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