mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +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:
@ -20,6 +20,7 @@ v1 = ["common_utils/v1"]
|
||||
v2 = ["common_utils/v2", "customer_v2"]
|
||||
customer_v2 = ["common_utils/customer_v2"]
|
||||
payment_methods_v2 = ["common_utils/payment_methods_v2"]
|
||||
dynamic_routing = []
|
||||
|
||||
[dependencies]
|
||||
actix-web = { version = "4.5.1", optional = true }
|
||||
|
||||
@ -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