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

This commit is contained in:
Sahkal Poddar
2024-02-27 18:48:27 +05:30
committed by GitHub
parent fbe9d2f19e
commit cd8222820a
3 changed files with 4 additions and 2 deletions

View File

@ -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, &[]);

View File

@ -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

View File

@ -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.