mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat: Added grpc based health check (#6441)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
use std::collections::hash_map::HashMap;
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct RouterHealthCheckResponse {
|
||||
pub database: bool,
|
||||
@ -9,10 +10,22 @@ pub struct RouterHealthCheckResponse {
|
||||
#[cfg(feature = "olap")]
|
||||
pub opensearch: bool,
|
||||
pub outgoing_request: bool,
|
||||
#[cfg(feature = "dynamic_routing")]
|
||||
pub grpc_health_check: HealthCheckMap,
|
||||
}
|
||||
|
||||
impl common_utils::events::ApiEventMetric for RouterHealthCheckResponse {}
|
||||
|
||||
/// gRPC based services eligible for Health check
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum HealthCheckServices {
|
||||
/// Dynamic routing service
|
||||
DynamicRoutingService,
|
||||
}
|
||||
|
||||
pub type HealthCheckMap = HashMap<HealthCheckServices, bool>;
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct SchedulerHealthCheckResponse {
|
||||
pub database: bool,
|
||||
|
||||
Reference in New Issue
Block a user