Skip to content

Commit

Permalink
fix: dont populate if component is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dracarys18 committed Feb 6, 2024
1 parent 423c4a0 commit fb9faa1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/api_models/src/health_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
pub struct RouterHealthCheckResponse {
pub database: bool,
pub redis: bool,
pub vault: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub vault: Option<bool>,
#[cfg(feature = "olap")]
pub analytics: bool,
pub outgoing_request: bool,
Expand Down Expand Up @@ -31,5 +32,14 @@ impl From<HealthState> for bool {
}
}
}
impl From<HealthState> for Option<bool> {
fn from(value: HealthState) -> Self {
match value {
HealthState::Running => Some(true),
HealthState::Error => Some(false),
HealthState::NotApplicable => None,
}
}
}

impl common_utils::events::ApiEventMetric for SchedulerHealthCheckResponse {}

0 comments on commit fb9faa1

Please sign in to comment.