mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
refactor(router): added logs health and deep health (#3780)
This commit is contained in:
@ -11,7 +11,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
/// .
|
/// .
|
||||||
// #[logger::instrument(skip_all, name = "name1", level = "warn", fields( key1 = "val1" ))]
|
// #[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")]
|
// #[actix_web::get("/health")]
|
||||||
pub async fn health() -> impl actix_web::Responder {
|
pub async fn health() -> impl actix_web::Responder {
|
||||||
metrics::HEALTH_METRIC.add(&metrics::CONTEXT, 1, &[]);
|
metrics::HEALTH_METRIC.add(&metrics::CONTEXT, 1, &[]);
|
||||||
|
|||||||
@ -87,7 +87,7 @@ impl From<Flow> for ApiIdentifier {
|
|||||||
|
|
||||||
Flow::EphemeralKeyCreate | Flow::EphemeralKeyDelete => Self::Ephemeral,
|
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::MandatesRetrieve | Flow::MandatesRevoke | Flow::MandatesList => Self::Mandates,
|
||||||
|
|
||||||
Flow::PaymentMethodsCreate
|
Flow::PaymentMethodsCreate
|
||||||
|
|||||||
@ -57,6 +57,8 @@ pub enum Tag {
|
|||||||
/// API Flow
|
/// API Flow
|
||||||
#[derive(Debug, Display, Clone, PartialEq, Eq)]
|
#[derive(Debug, Display, Clone, PartialEq, Eq)]
|
||||||
pub enum Flow {
|
pub enum Flow {
|
||||||
|
/// Health check
|
||||||
|
HealthCheck,
|
||||||
/// Deep health Check
|
/// Deep health Check
|
||||||
DeepHealthCheck,
|
DeepHealthCheck,
|
||||||
/// Merchants account create flow.
|
/// Merchants account create flow.
|
||||||
|
|||||||
Reference in New Issue
Block a user