Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(router): added logs health and deep health (#3780)

Sahkal Poddarcd8222820a19
diff --git a/crates/router/src/routes/health.rs b/crates/router/src/routes/health.rs
index a00ba011bf..2afb1c064e 100644
--- a/crates/router/src/routes/health.rs
+++ b/crates/router/src/routes/health.rs
@@ -11,7 +11,7 @@ use crate::{
};
/// .
// #[logger::instrument(skip_all, name = "name1", level = "warn", fields( key1 = "val1" ))]
-#[instrument(skip_all)]
+#[instrument(skip_all, fields(flow = ?Flow::HealthCheck))]
// #[actix_web::get("/health")]
pub async fn health() -> impl actix_web::Responder {
metrics::HEALTH_METRIC.add(&metrics::CONTEXT, 1, &[]);
diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs
index 0214d3b5e3..9471289a0c 100644
--- a/crates/router/src/routes/lock_utils.rs
+++ b/crates/router/src/routes/lock_utils.rs
@@ -87,7 +87,7 @@ impl From<Flow> for ApiIdentifier {
Flow::EphemeralKeyCreate | Flow::EphemeralKeyDelete => Self::Ephemeral,
- Flow::DeepHealthCheck => Self::Health,
+ Flow::DeepHealthCheck | Flow::HealthCheck => Self::Health,
Flow::MandatesRetrieve | Flow::MandatesRevoke | Flow::MandatesList => Self::Mandates,
Flow::PaymentMethodsCreate
diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs
index 0e768ae798..62c09c4245 100644
--- a/crates/router_env/src/logger/types.rs
+++ b/crates/router_env/src/logger/types.rs
@@ -57,6 +57,8 @@ pub enum Tag {
/// API Flow
#[derive(Debug, Display, Clone, PartialEq, Eq)]
pub enum Flow {
+ /// Health check
+ HealthCheck,
/// Deep health Check
DeepHealthCheck,
/// Merchants account create flow.