pub struct HealthRegistry { /* private fields */ }
Expand description
A registry of components and their health.
HealthRegistry
is responsible for tracking the health of all registered components, by storing both their
readiness, which indicates whether or not they are initialized and generally ready to process data, as well as
probing their liveness, which indicates if they’re currently responding, or able to respond, to requests.
§Telemetry
The health registry emits some internal telemetry about the status of registered components. In particular, three metrics are emitted:
health.component_ready
: whether or not a component is ready (gauge
,0
for not ready,1
for ready)health.component_alive
: whether or not a component is alive (gauge
,0
for not alive/unknown,1
for alive,-1
for dead)health.component_liveness_latency_secs
: the response latency of the component for liveness probes (histogram
, in seconds)
All metrics have a component_id
tag that corresponds to the name of the component that was given when registering it.
Implementations§
Source§impl HealthRegistry
impl HealthRegistry
Sourcepub fn register_component<S: Into<MetaString>>(&self, name: S) -> Option<Health>
pub fn register_component<S: Into<MetaString>>(&self, name: S) -> Option<Health>
Registers a component with the registry.
A handle is returned that must be used by the component to set its readiness as well as respond to liveness
probes. See Health::mark_ready
, Health::mark_not_ready
, and Health::live
for more information.
Sourcepub fn api_handler(&self) -> HealthAPIHandler
pub fn api_handler(&self) -> HealthAPIHandler
Gets an API handler for reporting the health of all components.
This handler exposes routes for querying the readiness and liveness of all registered components. See
HealthAPIHandler
for more information about routes and responses.
Trait Implementations§
Source§impl Clone for HealthRegistry
impl Clone for HealthRegistry
Source§fn clone(&self) -> HealthRegistry
fn clone(&self) -> HealthRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for HealthRegistry
impl RefUnwindSafe for HealthRegistry
impl Send for HealthRegistry
impl Sync for HealthRegistry
impl Unpin for HealthRegistry
impl UnwindSafe for HealthRegistry
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,
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>
§impl<T> Track for T
impl<T> Track for T
§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Tracked
wrapper. Read more§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Tracked
wrapper. Read more