mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
refactor: add basic counter metrics for IMC (#5006)
This commit is contained in:
@ -10,7 +10,7 @@ use api_models::{
|
||||
use common_utils::{errors::ReportSwitchExt, events::ApiEventsType};
|
||||
use error_stack::{report, ResultExt};
|
||||
use masking::ExposeInterface;
|
||||
use router_env::{instrument, tracing, tracing_actix_web::RequestId};
|
||||
use router_env::{instrument, metrics::add_attributes, tracing, tracing_actix_web::RequestId};
|
||||
|
||||
use super::{types, utils, MERCHANT_ID};
|
||||
use crate::{
|
||||
@ -25,9 +25,7 @@ use crate::{
|
||||
logger,
|
||||
routes::{
|
||||
app::{ReqState, SessionStateInfo},
|
||||
lock_utils,
|
||||
metrics::request::add_attributes,
|
||||
SessionState,
|
||||
lock_utils, SessionState,
|
||||
},
|
||||
services::{self, authentication as auth},
|
||||
types::{
|
||||
@ -567,10 +565,7 @@ async fn payments_incoming_webhook_flow(
|
||||
metrics::WEBHOOK_PAYMENT_NOT_FOUND.add(
|
||||
&metrics::CONTEXT,
|
||||
1,
|
||||
&[add_attributes(
|
||||
"merchant_id",
|
||||
merchant_account.merchant_id.clone(),
|
||||
)],
|
||||
&add_attributes([("merchant_id", merchant_account.merchant_id.clone())]),
|
||||
);
|
||||
return Ok(WebhookResponseTracker::NoEffect);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ use error_stack::{report, ResultExt};
|
||||
use masking::{ExposeInterface, Mask, PeekInterface, Secret};
|
||||
use router_env::{
|
||||
instrument,
|
||||
metrics::add_attributes,
|
||||
tracing::{self, Instrument},
|
||||
};
|
||||
|
||||
@ -22,7 +23,7 @@ use crate::{
|
||||
db::StorageInterface,
|
||||
events::outgoing_webhook_logs::{OutgoingWebhookEvent, OutgoingWebhookEventMetric},
|
||||
logger,
|
||||
routes::{app::SessionStateInfo, metrics::request::add_attributes, SessionState},
|
||||
routes::{app::SessionStateInfo, SessionState},
|
||||
services,
|
||||
types::{
|
||||
api,
|
||||
@ -501,7 +502,7 @@ pub(crate) async fn add_outgoing_webhook_retry_task_to_process_tracker(
|
||||
crate::routes::metrics::TASKS_ADDED_COUNT.add(
|
||||
&metrics::CONTEXT,
|
||||
1,
|
||||
&[add_attributes("flow", "OutgoingWebhookRetry")],
|
||||
&add_attributes([("flow", "OutgoingWebhookRetry")]),
|
||||
);
|
||||
Ok(process_tracker)
|
||||
}
|
||||
@ -509,7 +510,7 @@ pub(crate) async fn add_outgoing_webhook_retry_task_to_process_tracker(
|
||||
crate::routes::metrics::TASK_ADDITION_FAILURES_COUNT.add(
|
||||
&metrics::CONTEXT,
|
||||
1,
|
||||
&[add_attributes("flow", "OutgoingWebhookRetry")],
|
||||
&add_attributes([("flow", "OutgoingWebhookRetry")]),
|
||||
);
|
||||
Err(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user