mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat(metrics): add flow-specific metrics (#1259)
This commit is contained in:
committed by
GitHub
parent
71a17c682e
commit
5e90a369db
@ -34,7 +34,7 @@ use crate::{
|
||||
},
|
||||
db::StorageInterface,
|
||||
logger,
|
||||
routes::AppState,
|
||||
routes::{metrics, AppState},
|
||||
scheduler::utils as pt_utils,
|
||||
services::{self, api::Authenticate},
|
||||
types::{
|
||||
@ -285,6 +285,20 @@ pub trait PaymentRedirectFlow: Sync {
|
||||
merchant_account: storage::MerchantAccount,
|
||||
req: PaymentsRedirectResponseData,
|
||||
) -> RouterResponse<api::RedirectionResponse> {
|
||||
metrics::REDIRECTION_TRIGGERED.add(
|
||||
&metrics::CONTEXT,
|
||||
1,
|
||||
&[
|
||||
metrics::request::add_attributes(
|
||||
"connector",
|
||||
req.connector.to_owned().unwrap_or("null".to_string()),
|
||||
),
|
||||
metrics::request::add_attributes(
|
||||
"merchant_id",
|
||||
merchant_account.merchant_id.to_owned(),
|
||||
),
|
||||
],
|
||||
);
|
||||
let connector = req.connector.clone().get_required_value("connector")?;
|
||||
|
||||
let query_params = req.param.clone().get_required_value("param")?;
|
||||
|
||||
Reference in New Issue
Block a user