diff --git a/crates/diesel_models/src/query/address.rs b/crates/diesel_models/src/query/address.rs index ada4762299..ffcd740f07 100644 --- a/crates/diesel_models/src/query/address.rs +++ b/crates/diesel_models/src/query/address.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl AddressNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult
{ generics::generic_insert(conn, self).await } } impl Address { - #[instrument(skip(conn))] pub async fn find_by_address_id<'a>( conn: &PgPooledConn, address_id: &str, @@ -26,7 +23,6 @@ impl Address { .await } - #[instrument(skip(conn))] pub async fn update_by_address_id( conn: &PgPooledConn, address_id: String, @@ -56,7 +52,6 @@ impl Address { } } - #[instrument(skip(conn))] pub async fn update( self, conn: &PgPooledConn, @@ -82,7 +77,6 @@ impl Address { } } - #[instrument(skip(conn))] pub async fn delete_by_address_id( conn: &PgPooledConn, address_id: &str, @@ -110,7 +104,6 @@ impl Address { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_payment_id_address_id<'a>( conn: &PgPooledConn, merchant_id: &str, @@ -140,7 +133,6 @@ impl Address { } } - #[instrument(skip(conn))] pub async fn find_optional_by_address_id<'a>( conn: &PgPooledConn, address_id: &str, diff --git a/crates/diesel_models/src/query/api_keys.rs b/crates/diesel_models/src/query/api_keys.rs index b74142f729..ad7ec7c068 100644 --- a/crates/diesel_models/src/query/api_keys.rs +++ b/crates/diesel_models/src/query/api_keys.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl ApiKeyNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl ApiKey { - #[instrument(skip(conn))] pub async fn update_by_merchant_id_key_id( conn: &PgPooledConn, merchant_id: String, @@ -57,7 +54,6 @@ impl ApiKey { } } - #[instrument(skip(conn))] pub async fn revoke_by_merchant_id_key_id( conn: &PgPooledConn, merchant_id: &str, @@ -72,7 +68,6 @@ impl ApiKey { .await } - #[instrument(skip(conn))] pub async fn find_optional_by_merchant_id_key_id( conn: &PgPooledConn, merchant_id: &str, @@ -87,7 +82,6 @@ impl ApiKey { .await } - #[instrument(skip(conn))] pub async fn find_optional_by_hashed_api_key( conn: &PgPooledConn, hashed_api_key: HashedApiKey, @@ -99,7 +93,6 @@ impl ApiKey { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/authorization.rs b/crates/diesel_models/src/query/authorization.rs index dc9515bda5..59282c78f8 100644 --- a/crates/diesel_models/src/query/authorization.rs +++ b/crates/diesel_models/src/query/authorization.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -12,14 +11,12 @@ use crate::{ }; impl AuthorizationNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Authorization { - #[instrument(skip(conn))] pub async fn update_by_merchant_id_authorization_id( conn: &PgPooledConn, merchant_id: String, @@ -59,7 +56,6 @@ impl Authorization { } } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_payment_id( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/blocklist.rs b/crates/diesel_models/src/query/blocklist.rs index e1ba5fa923..2003a99700 100644 --- a/crates/diesel_models/src/query/blocklist.rs +++ b/crates/diesel_models/src/query/blocklist.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,14 +8,12 @@ use crate::{ }; impl BlocklistNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Blocklist { - #[instrument(skip(conn))] pub async fn find_by_merchant_id_fingerprint_id( conn: &PgPooledConn, merchant_id: &str, @@ -31,7 +28,6 @@ impl Blocklist { .await } - #[instrument(skip(conn))] pub async fn list_by_merchant_id_data_kind( conn: &PgPooledConn, merchant_id: &str, @@ -51,7 +47,6 @@ impl Blocklist { .await } - #[instrument(skip(conn))] pub async fn list_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, @@ -66,7 +61,6 @@ impl Blocklist { .await } - #[instrument(skip(conn))] pub async fn delete_by_merchant_id_fingerprint_id( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/blocklist_fingerprint.rs b/crates/diesel_models/src/query/blocklist_fingerprint.rs index 4f3d77e63a..370a06801c 100644 --- a/crates/diesel_models/src/query/blocklist_fingerprint.rs +++ b/crates/diesel_models/src/query/blocklist_fingerprint.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,14 +8,12 @@ use crate::{ }; impl BlocklistFingerprintNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl BlocklistFingerprint { - #[instrument(skip(conn))] pub async fn find_by_merchant_id_fingerprint_id( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/blocklist_lookup.rs b/crates/diesel_models/src/query/blocklist_lookup.rs index ea28c94e49..f5bc6eda5d 100644 --- a/crates/diesel_models/src/query/blocklist_lookup.rs +++ b/crates/diesel_models/src/query/blocklist_lookup.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,14 +8,12 @@ use crate::{ }; impl BlocklistLookupNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl BlocklistLookup { - #[instrument(skip(conn))] pub async fn find_by_merchant_id_fingerprint( conn: &PgPooledConn, merchant_id: &str, @@ -31,7 +28,6 @@ impl BlocklistLookup { .await } - #[instrument(skip(conn))] pub async fn delete_by_merchant_id_fingerprint( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/business_profile.rs b/crates/diesel_models/src/query/business_profile.rs index fcdd97ca9d..effe2219a6 100644 --- a/crates/diesel_models/src/query/business_profile.rs +++ b/crates/diesel_models/src/query/business_profile.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl BusinessProfileNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl BusinessProfile { - #[instrument(skip(conn))] pub async fn update_by_profile_id( self, conn: &PgPooledConn, @@ -38,7 +35,6 @@ impl BusinessProfile { } } - #[instrument(skip(conn))] pub async fn find_by_profile_id(conn: &PgPooledConn, profile_id: &str) -> StorageResult { generics::generic_find_one::<::Table, _, _>( conn, @@ -47,7 +43,6 @@ impl BusinessProfile { .await } - #[instrument(skip(conn))] pub async fn find_by_profile_name_merchant_id( conn: &PgPooledConn, profile_name: &str, diff --git a/crates/diesel_models/src/query/capture.rs b/crates/diesel_models/src/query/capture.rs index c5a5725f11..c39c4ec7f5 100644 --- a/crates/diesel_models/src/query/capture.rs +++ b/crates/diesel_models/src/query/capture.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl CaptureNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Capture { - #[instrument(skip(conn))] pub async fn find_by_capture_id(conn: &PgPooledConn, capture_id: &str) -> StorageResult { generics::generic_find_one::<::Table, _, _>( conn, @@ -25,7 +22,7 @@ impl Capture { ) .await } - #[instrument(skip(conn))] + pub async fn update_with_capture_id( self, conn: &PgPooledConn, @@ -51,7 +48,6 @@ impl Capture { } } - #[instrument(skip(conn))] pub async fn find_all_by_merchant_id_payment_id_authorized_attempt_id( merchant_id: &str, payment_id: &str, diff --git a/crates/diesel_models/src/query/configs.rs b/crates/diesel_models/src/query/configs.rs index 306fb5e335..b7745b3187 100644 --- a/crates/diesel_models/src/query/configs.rs +++ b/crates/diesel_models/src/query/configs.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,19 +9,16 @@ use crate::{ }; impl ConfigNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Config { - #[instrument(skip(conn))] pub async fn find_by_key(conn: &PgPooledConn, key: &str) -> StorageResult { generics::generic_find_by_id::<::Table, _, _>(conn, key.to_owned()).await } - #[instrument(skip(conn))] pub async fn update_by_key( conn: &PgPooledConn, key: &str, @@ -49,7 +45,6 @@ impl Config { } } - #[instrument(skip(conn))] pub async fn delete_by_key(conn: &PgPooledConn, key: &str) -> StorageResult { generics::generic_delete_one_with_result::<::Table, _, _>( conn, diff --git a/crates/diesel_models/src/query/customers.rs b/crates/diesel_models/src/query/customers.rs index 41dedbf864..e5ec96c8fc 100644 --- a/crates/diesel_models/src/query/customers.rs +++ b/crates/diesel_models/src/query/customers.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl CustomerNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Customer { - #[instrument(skip(conn))] pub async fn update_by_customer_id_merchant_id( conn: &PgPooledConn, customer_id: String, @@ -45,7 +42,6 @@ impl Customer { } } - #[instrument(skip(conn))] pub async fn delete_by_customer_id_merchant_id( conn: &PgPooledConn, customer_id: &str, @@ -60,7 +56,6 @@ impl Customer { .await } - #[instrument(skip(conn))] pub async fn find_by_customer_id_merchant_id( conn: &PgPooledConn, customer_id: &str, @@ -73,7 +68,6 @@ impl Customer { .await } - #[instrument(skip(conn))] pub async fn list_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, @@ -88,7 +82,6 @@ impl Customer { .await } - #[instrument(skip(conn))] pub async fn find_optional_by_customer_id_merchant_id( conn: &PgPooledConn, customer_id: &str, diff --git a/crates/diesel_models/src/query/dashboard_metadata.rs b/crates/diesel_models/src/query/dashboard_metadata.rs index d91a407812..6f88629d82 100644 --- a/crates/diesel_models/src/query/dashboard_metadata.rs +++ b/crates/diesel_models/src/query/dashboard_metadata.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::tracing::{self, instrument}; use crate::{ enums, @@ -13,7 +12,6 @@ use crate::{ }; impl DashboardMetadataNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/query/dispute.rs b/crates/diesel_models/src/query/dispute.rs index 78696d9e9c..974ed84e23 100644 --- a/crates/diesel_models/src/query/dispute.rs +++ b/crates/diesel_models/src/query/dispute.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl DisputeNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Dispute { - #[instrument(skip(conn))] pub async fn find_by_merchant_id_payment_id_connector_dispute_id( conn: &PgPooledConn, merchant_id: &str, @@ -70,7 +67,6 @@ impl Dispute { .await } - #[instrument(skip(conn))] pub async fn update(self, conn: &PgPooledConn, dispute: DisputeUpdate) -> StorageResult { match generics::generic_update_with_unique_predicate_get_result::< ::Table, diff --git a/crates/diesel_models/src/query/events.rs b/crates/diesel_models/src/query/events.rs index c8711abf9e..735bd89250 100644 --- a/crates/diesel_models/src/query/events.rs +++ b/crates/diesel_models/src/query/events.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,14 +8,12 @@ use crate::{ }; impl EventNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Event { - #[instrument(skip(conn))] pub async fn update( conn: &PgPooledConn, event_id: &str, diff --git a/crates/diesel_models/src/query/file.rs b/crates/diesel_models/src/query/file.rs index 0314b04fb2..be81d1bf26 100644 --- a/crates/diesel_models/src/query/file.rs +++ b/crates/diesel_models/src/query/file.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl FileMetadataNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl FileMetadata { - #[instrument(skip(conn))] pub async fn find_by_merchant_id_file_id( conn: &PgPooledConn, merchant_id: &str, @@ -32,7 +29,6 @@ impl FileMetadata { .await } - #[instrument(skip(conn))] pub async fn delete_by_merchant_id_file_id( conn: &PgPooledConn, merchant_id: &str, @@ -47,7 +43,6 @@ impl FileMetadata { .await } - #[instrument(skip(conn))] pub async fn update( self, conn: &PgPooledConn, diff --git a/crates/diesel_models/src/query/fraud_check.rs b/crates/diesel_models/src/query/fraud_check.rs index b63b48c193..18eee0c728 100644 --- a/crates/diesel_models/src/query/fraud_check.rs +++ b/crates/diesel_models/src/query/fraud_check.rs @@ -1,19 +1,16 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::tracing::{self, instrument}; use crate::{ errors, fraud_check::*, query::generics, schema::fraud_check::dsl, PgPooledConn, StorageResult, }; impl FraudCheckNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl FraudCheck { - #[instrument(skip(conn))] pub async fn update_with_attempt_id( self, conn: &PgPooledConn, diff --git a/crates/diesel_models/src/query/generics.rs b/crates/diesel_models/src/query/generics.rs index 667b2516bd..8f2e391df6 100644 --- a/crates/diesel_models/src/query/generics.rs +++ b/crates/diesel_models/src/query/generics.rs @@ -20,7 +20,7 @@ use diesel::{ Expression, Insertable, QueryDsl, QuerySource, Table, }; use error_stack::{report, IntoReport, ResultExt}; -use router_env::{instrument, logger, tracing}; +use router_env::logger; use crate::{ errors::{self}, @@ -71,7 +71,6 @@ pub mod db_metrics { use db_metrics::*; -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_insert(conn: &PgPooledConn, values: V) -> StorageResult where T: HasTable + Table + 'static + Debug, @@ -102,7 +101,6 @@ where .attach_printable_lazy(|| format!("Error while inserting {debug_values}")) } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_update( conn: &PgPooledConn, predicate: P, @@ -130,7 +128,6 @@ where .attach_printable_lazy(|| format!("Error while updating {debug_values}")) } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_update_with_results( conn: &PgPooledConn, predicate: P, @@ -178,7 +175,6 @@ where } } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_update_with_unique_predicate_get_result( conn: &PgPooledConn, predicate: P, @@ -216,7 +212,6 @@ where })? } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_update_by_id( conn: &PgPooledConn, id: Pk, @@ -267,7 +262,6 @@ where } } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_delete(conn: &PgPooledConn, predicate: P) -> StorageResult where T: FilterDsl

+ HasTable

+ Table + 'static, @@ -297,7 +291,6 @@ where }) } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_delete_one_with_result( conn: &PgPooledConn, predicate: P, @@ -330,7 +323,6 @@ where }) } -#[instrument(level = "DEBUG", skip_all)] async fn generic_find_by_id_core(conn: &PgPooledConn, id: Pk) -> StorageResult where T: FindDsl + HasTable
+ LimitDsl + Table + 'static, @@ -355,7 +347,6 @@ where .attach_printable_lazy(|| format!("Error finding record by primary key: {id:?}")) } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_find_by_id(conn: &PgPooledConn, id: Pk) -> StorageResult where T: FindDsl + HasTable
+ LimitDsl + Table + 'static, @@ -367,7 +358,6 @@ where generic_find_by_id_core::(conn, id).await } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_find_by_id_optional( conn: &PgPooledConn, id: Pk, @@ -383,7 +373,6 @@ where to_optional(generic_find_by_id_core::(conn, id).await) } -#[instrument(level = "DEBUG", skip_all)] async fn generic_find_one_core(conn: &PgPooledConn, predicate: P) -> StorageResult where T: FilterDsl

+ HasTable

+ Table + 'static, @@ -403,7 +392,6 @@ where .attach_printable_lazy(|| "Error finding record by predicate") } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_find_one(conn: &PgPooledConn, predicate: P) -> StorageResult where T: FilterDsl

+ HasTable

+ Table + 'static, @@ -413,7 +401,6 @@ where generic_find_one_core::(conn, predicate).await } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_find_one_optional( conn: &PgPooledConn, predicate: P, @@ -426,7 +413,6 @@ where to_optional(generic_find_one_core::(conn, predicate).await) } -#[instrument(level = "DEBUG", skip_all)] pub async fn generic_filter( conn: &PgPooledConn, predicate: P, diff --git a/crates/diesel_models/src/query/locker_mock_up.rs b/crates/diesel_models/src/query/locker_mock_up.rs index 381905d6be..4ce52cfc40 100644 --- a/crates/diesel_models/src/query/locker_mock_up.rs +++ b/crates/diesel_models/src/query/locker_mock_up.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,14 +8,12 @@ use crate::{ }; impl LockerMockUpNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl LockerMockUp { - #[instrument(skip(conn))] pub async fn find_by_card_id(conn: &PgPooledConn, card_id: &str) -> StorageResult { generics::generic_find_one::<::Table, _, _>( conn, @@ -25,7 +22,6 @@ impl LockerMockUp { .await } - #[instrument(skip(conn))] pub async fn delete_by_card_id(conn: &PgPooledConn, card_id: &str) -> StorageResult { generics::generic_delete_one_with_result::<::Table, _, _>( conn, diff --git a/crates/diesel_models/src/query/mandate.rs b/crates/diesel_models/src/query/mandate.rs index 00075528e5..0baae87c51 100644 --- a/crates/diesel_models/src/query/mandate.rs +++ b/crates/diesel_models/src/query/mandate.rs @@ -1,12 +1,10 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table}; use error_stack::report; -use router_env::{instrument, tracing}; use super::generics; use crate::{errors, mandate::*, schema::mandate::dsl, PgPooledConn, StorageResult}; impl MandateNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/query/merchant_account.rs b/crates/diesel_models/src/query/merchant_account.rs index ba20f2e366..1d4eef7520 100644 --- a/crates/diesel_models/src/query/merchant_account.rs +++ b/crates/diesel_models/src/query/merchant_account.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, ExpressionMethods, Table}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl MerchantAccountNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl MerchantAccount { - #[instrument(skip(conn))] pub async fn update( self, conn: &PgPooledConn, @@ -67,7 +64,6 @@ impl MerchantAccount { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, @@ -79,7 +75,6 @@ impl MerchantAccount { .await } - #[instrument(skip_all)] pub async fn find_by_publishable_key( conn: &PgPooledConn, publishable_key: &str, @@ -91,7 +86,6 @@ impl MerchantAccount { .await } - #[instrument(skip_all)] pub async fn list_by_organization_id( conn: &PgPooledConn, organization_id: &str, @@ -111,7 +105,6 @@ impl MerchantAccount { .await } - #[instrument(skip_all)] pub async fn list_multiple_merchant_accounts( conn: &PgPooledConn, merchant_ids: Vec, diff --git a/crates/diesel_models/src/query/merchant_connector_account.rs b/crates/diesel_models/src/query/merchant_connector_account.rs index e9ef4eabff..bd24d12ec2 100644 --- a/crates/diesel_models/src/query/merchant_connector_account.rs +++ b/crates/diesel_models/src/query/merchant_connector_account.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -13,14 +12,12 @@ use crate::{ }; impl MerchantConnectorAccountNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl MerchantConnectorAccount { - #[instrument(skip(conn))] pub async fn update( self, conn: &PgPooledConn, @@ -55,7 +52,6 @@ impl MerchantConnectorAccount { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_connector( conn: &PgPooledConn, merchant_id: &str, @@ -70,7 +66,6 @@ impl MerchantConnectorAccount { .await } - #[instrument(skip(conn))] pub async fn find_by_profile_id_connector_name( conn: &PgPooledConn, profile_id: &str, @@ -85,7 +80,6 @@ impl MerchantConnectorAccount { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_connector_name( conn: &PgPooledConn, merchant_id: &str, @@ -108,7 +102,6 @@ impl MerchantConnectorAccount { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_merchant_connector_id( conn: &PgPooledConn, merchant_id: &str, @@ -123,7 +116,6 @@ impl MerchantConnectorAccount { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/merchant_key_store.rs b/crates/diesel_models/src/query/merchant_key_store.rs index 0e2ec1ddad..1be82cb2c1 100644 --- a/crates/diesel_models/src/query/merchant_key_store.rs +++ b/crates/diesel_models/src/query/merchant_key_store.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,14 +8,12 @@ use crate::{ }; impl MerchantKeyStoreNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl MerchantKeyStore { - #[instrument(skip(conn))] pub async fn find_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, @@ -28,7 +25,6 @@ impl MerchantKeyStore { .await } - #[instrument(skip(conn))] pub async fn delete_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, @@ -40,7 +36,6 @@ impl MerchantKeyStore { .await } - #[instrument(skip(conn))] pub async fn list_multiple_key_stores( conn: &PgPooledConn, merchant_ids: Vec, diff --git a/crates/diesel_models/src/query/organization.rs b/crates/diesel_models/src/query/organization.rs index 0bea1012c9..ea8698204d 100644 --- a/crates/diesel_models/src/query/organization.rs +++ b/crates/diesel_models/src/query/organization.rs @@ -1,12 +1,10 @@ use diesel::{associations::HasTable, ExpressionMethods}; -use router_env::tracing::{self, instrument}; use crate::{ organization::*, query::generics, schema::organization::dsl, PgPooledConn, StorageResult, }; impl OrganizationNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/query/payment_attempt.rs b/crates/diesel_models/src/query/payment_attempt.rs index ebd0dcd735..7e44059927 100644 --- a/crates/diesel_models/src/query/payment_attempt.rs +++ b/crates/diesel_models/src/query/payment_attempt.rs @@ -6,7 +6,6 @@ use diesel::{ QueryDsl, Table, }; use error_stack::{IntoReport, ResultExt}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -21,14 +20,12 @@ use crate::{ }; impl PaymentAttemptNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self.populate_derived_fields()).await } } impl PaymentAttempt { - #[instrument(skip(conn))] pub async fn update_with_attempt_id( self, conn: &PgPooledConn, @@ -56,7 +53,6 @@ impl PaymentAttempt { } } - #[instrument(skip(conn))] pub async fn find_optional_by_payment_id_merchant_id( conn: &PgPooledConn, payment_id: &str, @@ -71,7 +67,6 @@ impl PaymentAttempt { .await } - #[instrument(skip(conn))] pub async fn find_by_connector_transaction_id_payment_id_merchant_id( conn: &PgPooledConn, connector_transaction_id: &str, @@ -156,7 +151,6 @@ impl PaymentAttempt { ) } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_connector_txn_id( conn: &PgPooledConn, merchant_id: &str, @@ -171,7 +165,6 @@ impl PaymentAttempt { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_attempt_id( conn: &PgPooledConn, merchant_id: &str, @@ -186,7 +179,6 @@ impl PaymentAttempt { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_preprocessing_id( conn: &PgPooledConn, merchant_id: &str, @@ -201,7 +193,6 @@ impl PaymentAttempt { .await } - #[instrument(skip(conn))] pub async fn find_by_payment_id_merchant_id_attempt_id( conn: &PgPooledConn, payment_id: &str, @@ -219,7 +210,6 @@ impl PaymentAttempt { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_payment_id( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/payment_intent.rs b/crates/diesel_models/src/query/payment_intent.rs index 7de8f4d9bd..82904e5a56 100644 --- a/crates/diesel_models/src/query/payment_intent.rs +++ b/crates/diesel_models/src/query/payment_intent.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -12,14 +11,12 @@ use crate::{ }; impl PaymentIntentNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl PaymentIntent { - #[instrument(skip(conn))] pub async fn update( self, conn: &PgPooledConn, @@ -44,7 +41,6 @@ impl PaymentIntent { } } - #[instrument(skip(conn))] pub async fn find_by_payment_id_merchant_id( conn: &PgPooledConn, payment_id: &str, @@ -59,7 +55,6 @@ impl PaymentIntent { .await } - #[instrument(skip(conn))] pub async fn find_optional_by_payment_id_merchant_id( conn: &PgPooledConn, payment_id: &str, diff --git a/crates/diesel_models/src/query/payment_link.rs b/crates/diesel_models/src/query/payment_link.rs index 085257633c..154e753699 100644 --- a/crates/diesel_models/src/query/payment_link.rs +++ b/crates/diesel_models/src/query/payment_link.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,7 +8,6 @@ use crate::{ }; impl PaymentLinkNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/query/payment_method.rs b/crates/diesel_models/src/query/payment_method.rs index e3f2e51137..bed4d07901 100644 --- a/crates/diesel_models/src/query/payment_method.rs +++ b/crates/diesel_models/src/query/payment_method.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl PaymentMethodNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl PaymentMethod { - #[instrument(skip(conn))] pub async fn delete_by_payment_method_id( conn: &PgPooledConn, payment_method_id: String, @@ -29,7 +26,6 @@ impl PaymentMethod { .await } - #[instrument(skip(conn))] pub async fn delete_by_merchant_id_payment_method_id( conn: &PgPooledConn, merchant_id: &str, @@ -44,7 +40,6 @@ impl PaymentMethod { .await } - #[instrument(skip(conn))] pub async fn find_by_locker_id(conn: &PgPooledConn, locker_id: &str) -> StorageResult { generics::generic_find_one::<::Table, _, _>( conn, @@ -53,7 +48,6 @@ impl PaymentMethod { .await } - #[instrument(skip(conn))] pub async fn find_by_payment_method_id( conn: &PgPooledConn, payment_method_id: &str, @@ -65,7 +59,6 @@ impl PaymentMethod { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, @@ -85,7 +78,6 @@ impl PaymentMethod { .await } - #[instrument(skip(conn))] pub async fn find_by_customer_id_merchant_id( conn: &PgPooledConn, customer_id: &str, @@ -104,7 +96,6 @@ impl PaymentMethod { .await } - #[instrument(skip(conn))] pub async fn find_by_customer_id_merchant_id_status( conn: &PgPooledConn, customer_id: &str, diff --git a/crates/diesel_models/src/query/payout_attempt.rs b/crates/diesel_models/src/query/payout_attempt.rs index f27c775d92..a2e70a4997 100644 --- a/crates/diesel_models/src/query/payout_attempt.rs +++ b/crates/diesel_models/src/query/payout_attempt.rs @@ -1,6 +1,5 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; use error_stack::report; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -13,7 +12,6 @@ use crate::{ }; impl PayoutAttemptNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/query/refund.rs b/crates/diesel_models/src/query/refund.rs index a9980af7f1..0d5d1baf93 100644 --- a/crates/diesel_models/src/query/refund.rs +++ b/crates/diesel_models/src/query/refund.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -10,14 +9,12 @@ use crate::{ }; impl RefundNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } } impl Refund { - #[instrument(skip(conn))] pub async fn update(self, conn: &PgPooledConn, refund: RefundUpdate) -> StorageResult { match generics::generic_update_with_unique_predicate_get_result::< ::Table, @@ -42,7 +39,6 @@ impl Refund { } // This is required to be changed for KV. - #[instrument(skip(conn))] pub async fn find_by_merchant_id_refund_id( conn: &PgPooledConn, merchant_id: &str, @@ -57,7 +53,6 @@ impl Refund { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_connector_refund_id_connector( conn: &PgPooledConn, merchant_id: &str, @@ -74,7 +69,6 @@ impl Refund { .await } - #[instrument(skip(conn))] pub async fn find_by_internal_reference_id_merchant_id( conn: &PgPooledConn, internal_reference_id: &str, @@ -89,7 +83,6 @@ impl Refund { .await } - #[instrument(skip(conn))] pub async fn find_by_merchant_id_connector_transaction_id( conn: &PgPooledConn, merchant_id: &str, @@ -112,7 +105,6 @@ impl Refund { .await } - #[instrument(skip(conn))] pub async fn find_by_payment_id_merchant_id( conn: &PgPooledConn, payment_id: &str, diff --git a/crates/diesel_models/src/query/reverse_lookup.rs b/crates/diesel_models/src/query/reverse_lookup.rs index 351277ca15..cfd4ab09a6 100644 --- a/crates/diesel_models/src/query/reverse_lookup.rs +++ b/crates/diesel_models/src/query/reverse_lookup.rs @@ -1,5 +1,4 @@ use diesel::{associations::HasTable, ExpressionMethods}; -use router_env::{instrument, tracing}; use super::generics; use crate::{ @@ -9,11 +8,10 @@ use crate::{ }; impl ReverseLookupNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } - #[instrument(skip(conn))] + pub async fn batch_insert( reverse_lookups: Vec, conn: &PgPooledConn, diff --git a/crates/diesel_models/src/query/role.rs b/crates/diesel_models/src/query/role.rs index a54576cc91..73b596171d 100644 --- a/crates/diesel_models/src/query/role.rs +++ b/crates/diesel_models/src/query/role.rs @@ -1,12 +1,10 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::tracing::{self, instrument}; use crate::{ enums::RoleScope, query::generics, role::*, schema::roles::dsl, PgPooledConn, StorageResult, }; impl RoleNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/query/routing_algorithm.rs b/crates/diesel_models/src/query/routing_algorithm.rs index b2a9687aa4..28a5e6816e 100644 --- a/crates/diesel_models/src/query/routing_algorithm.rs +++ b/crates/diesel_models/src/query/routing_algorithm.rs @@ -1,7 +1,6 @@ use async_bb8_diesel::AsyncRunQueryDsl; use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, QueryDsl}; use error_stack::{IntoReport, ResultExt}; -use router_env::tracing::{self, instrument}; use time::PrimitiveDateTime; use crate::{ @@ -14,12 +13,10 @@ use crate::{ }; impl RoutingAlgorithm { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } - #[instrument(skip(conn))] pub async fn find_by_algorithm_id_merchant_id( conn: &PgPooledConn, algorithm_id: &str, @@ -34,7 +31,6 @@ impl RoutingAlgorithm { .await } - #[instrument(skip(conn))] pub async fn find_by_algorithm_id_profile_id( conn: &PgPooledConn, algorithm_id: &str, @@ -49,7 +45,6 @@ impl RoutingAlgorithm { .await } - #[instrument(skip(conn))] pub async fn find_metadata_by_algorithm_id_profile_id( conn: &PgPooledConn, algorithm_id: &str, @@ -114,7 +109,6 @@ impl RoutingAlgorithm { ) } - #[instrument(skip(conn))] pub async fn list_metadata_by_profile_id( conn: &PgPooledConn, profile_id: &str, @@ -171,7 +165,6 @@ impl RoutingAlgorithm { .collect()) } - #[instrument(skip(conn))] pub async fn list_metadata_by_merchant_id( conn: &PgPooledConn, merchant_id: &str, @@ -233,7 +226,6 @@ impl RoutingAlgorithm { .collect()) } - #[instrument(skip(conn))] pub async fn list_metadata_by_merchant_id_transaction_type( conn: &PgPooledConn, merchant_id: &str, diff --git a/crates/diesel_models/src/query/user.rs b/crates/diesel_models/src/query/user.rs index 6fb5b79ddc..9254a04de2 100644 --- a/crates/diesel_models/src/query/user.rs +++ b/crates/diesel_models/src/query/user.rs @@ -4,10 +4,7 @@ use diesel::{ JoinOnDsl, QueryDsl, }; use error_stack::IntoReport; -use router_env::{ - logger, - tracing::{self, instrument}, -}; +use router_env::logger; pub mod sample_data; use crate::{ @@ -23,7 +20,6 @@ use crate::{ }; impl UserNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/query/user_role.rs b/crates/diesel_models/src/query/user_role.rs index 5e759cf826..4cce0d3f80 100644 --- a/crates/diesel_models/src/query/user_role.rs +++ b/crates/diesel_models/src/query/user_role.rs @@ -1,10 +1,8 @@ use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods}; -use router_env::tracing::{self, instrument}; use crate::{query::generics, schema::user_roles::dsl, user_role::*, PgPooledConn, StorageResult}; impl UserRoleNew { - #[instrument(skip(conn))] pub async fn insert(self, conn: &PgPooledConn) -> StorageResult { generics::generic_insert(conn, self).await } diff --git a/crates/diesel_models/src/user/dashboard_metadata.rs b/crates/diesel_models/src/user/dashboard_metadata.rs index 1eeb61d613..48028ba6b5 100644 --- a/crates/diesel_models/src/user/dashboard_metadata.rs +++ b/crates/diesel_models/src/user/dashboard_metadata.rs @@ -45,6 +45,7 @@ pub struct DashboardMetadataUpdateInternal { pub last_modified_at: PrimitiveDateTime, } +#[derive(Debug)] pub enum DashboardMetadataUpdate { UpdateData { data_key: enums::DashboardMetadata, diff --git a/crates/router/src/db/address.rs b/crates/router/src/db/address.rs index 311fdc127d..4e4f933be4 100644 --- a/crates/router/src/db/address.rs +++ b/crates/router/src/db/address.rs @@ -1,6 +1,5 @@ use diesel_models::{address::AddressUpdateInternal, enums::MerchantStorageScheme}; use error_stack::ResultExt; -use router_env::{instrument, tracing}; use super::MockDb; use crate::{ @@ -95,6 +94,7 @@ mod storage { }; #[async_trait::async_trait] impl AddressInterface for Store { + #[instrument(skip_all)] async fn find_address_by_address_id( &self, address_id: &str, @@ -114,6 +114,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn find_address_by_merchant_id_payment_id_address_id( &self, merchant_id: &str, @@ -162,6 +163,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn update_address_for_payments( &self, this: domain::Address, @@ -188,6 +190,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn insert_address_for_payments( &self, _payment_id: &str, @@ -213,6 +216,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn insert_address_for_customers( &self, address: domain::Address, @@ -236,6 +240,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn update_address_by_merchant_id_customer_id( &self, customer_id: &str, @@ -295,6 +300,7 @@ mod storage { }; #[async_trait::async_trait] impl AddressInterface for Store { + #[instrument(skip_all)] async fn find_address_by_address_id( &self, address_id: &str, @@ -314,6 +320,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn find_address_by_merchant_id_payment_id_address_id( &self, merchant_id: &str, @@ -381,6 +388,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn update_address_for_payments( &self, this: domain::Address, @@ -449,6 +457,7 @@ mod storage { } } + #[instrument(skip_all)] async fn insert_address_for_payments( &self, payment_id: &str, @@ -538,6 +547,7 @@ mod storage { } } + #[instrument(skip_all)] async fn insert_address_for_customers( &self, address: domain::Address, @@ -561,6 +571,7 @@ mod storage { .await } + #[instrument(skip_all)] async fn update_address_by_merchant_id_customer_id( &self, customer_id: &str, @@ -650,7 +661,6 @@ impl AddressInterface for MockDb { } } - #[instrument(skip_all)] async fn update_address( &self, address_id: String, diff --git a/crates/router/src/db/api_keys.rs b/crates/router/src/db/api_keys.rs index 94edac9690..c0d9ea3641 100644 --- a/crates/router/src/db/api_keys.rs +++ b/crates/router/src/db/api_keys.rs @@ -1,4 +1,5 @@ use error_stack::IntoReport; +use router_env::{instrument, tracing}; #[cfg(feature = "accounts_cache")] use storage_impl::redis::cache::CacheKind; #[cfg(feature = "accounts_cache")] @@ -52,6 +53,7 @@ pub trait ApiKeyInterface { #[async_trait::async_trait] impl ApiKeyInterface for Store { + #[instrument(skip_all)] async fn insert_api_key( &self, api_key: storage::ApiKeyNew, @@ -64,6 +66,7 @@ impl ApiKeyInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_api_key( &self, merchant_id: String, @@ -113,6 +116,7 @@ impl ApiKeyInterface for Store { } } + #[instrument(skip_all)] async fn revoke_api_key( &self, merchant_id: &str, @@ -156,6 +160,7 @@ impl ApiKeyInterface for Store { } } + #[instrument(skip_all)] async fn find_api_key_by_merchant_id_key_id_optional( &self, merchant_id: &str, @@ -168,6 +173,7 @@ impl ApiKeyInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_api_key_by_hash_optional( &self, hashed_api_key: storage::HashedApiKey, @@ -198,6 +204,7 @@ impl ApiKeyInterface for Store { } } + #[instrument(skip_all)] async fn list_api_keys_by_merchant_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/authorization.rs b/crates/router/src/db/authorization.rs index d167d17753..322be5fc6d 100644 --- a/crates/router/src/db/authorization.rs +++ b/crates/router/src/db/authorization.rs @@ -1,5 +1,6 @@ use diesel_models::authorization::AuthorizationUpdateInternal; use error_stack::IntoReport; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -31,6 +32,7 @@ pub trait AuthorizationInterface { #[async_trait::async_trait] impl AuthorizationInterface for Store { + #[instrument(skip_all)] async fn insert_authorization( &self, authorization: storage::AuthorizationNew, @@ -43,6 +45,7 @@ impl AuthorizationInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_all_authorizations_by_merchant_id_payment_id( &self, merchant_id: &str, @@ -55,6 +58,7 @@ impl AuthorizationInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_authorization_by_merchant_id_authorization_id( &self, merchant_id: String, diff --git a/crates/router/src/db/blocklist.rs b/crates/router/src/db/blocklist.rs index 93361552de..083c988b8d 100644 --- a/crates/router/src/db/blocklist.rs +++ b/crates/router/src/db/blocklist.rs @@ -58,6 +58,7 @@ impl BlocklistInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_blocklist_entry_by_merchant_id_fingerprint_id( &self, merchant_id: &str, @@ -70,6 +71,7 @@ impl BlocklistInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_blocklist_entries_by_merchant_id( &self, merchant_id: &str, @@ -81,6 +83,7 @@ impl BlocklistInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_blocklist_entries_by_merchant_id_data_kind( &self, merchant_id: &str, @@ -101,6 +104,7 @@ impl BlocklistInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_blocklist_entry_by_merchant_id_fingerprint_id( &self, merchant_id: &str, @@ -168,6 +172,7 @@ impl BlocklistInterface for KafkaStore { self.diesel_store.insert_blocklist_entry(pm_blocklist).await } + #[instrument(skip_all)] async fn find_blocklist_entry_by_merchant_id_fingerprint_id( &self, merchant_id: &str, @@ -178,6 +183,7 @@ impl BlocklistInterface for KafkaStore { .await } + #[instrument(skip_all)] async fn delete_blocklist_entry_by_merchant_id_fingerprint_id( &self, merchant_id: &str, @@ -188,6 +194,7 @@ impl BlocklistInterface for KafkaStore { .await } + #[instrument(skip_all)] async fn list_blocklist_entries_by_merchant_id_data_kind( &self, merchant_id: &str, @@ -200,6 +207,7 @@ impl BlocklistInterface for KafkaStore { .await } + #[instrument(skip_all)] async fn list_blocklist_entries_by_merchant_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/blocklist_fingerprint.rs b/crates/router/src/db/blocklist_fingerprint.rs index d9107d3d1c..1be6f60e87 100644 --- a/crates/router/src/db/blocklist_fingerprint.rs +++ b/crates/router/src/db/blocklist_fingerprint.rs @@ -39,6 +39,7 @@ impl BlocklistFingerprintInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_blocklist_fingerprint_by_merchant_id_fingerprint_id( &self, merchant_id: &str, @@ -58,7 +59,6 @@ impl BlocklistFingerprintInterface for Store { #[async_trait::async_trait] impl BlocklistFingerprintInterface for MockDb { - #[instrument(skip_all)] async fn insert_blocklist_fingerprint_entry( &self, _pm_fingerprint_new: storage::BlocklistFingerprintNew, @@ -87,6 +87,7 @@ impl BlocklistFingerprintInterface for KafkaStore { .await } + #[instrument(skip_all)] async fn find_blocklist_fingerprint_by_merchant_id_fingerprint_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/blocklist_lookup.rs b/crates/router/src/db/blocklist_lookup.rs index 5060fac7f6..ad8315b757 100644 --- a/crates/router/src/db/blocklist_lookup.rs +++ b/crates/router/src/db/blocklist_lookup.rs @@ -45,6 +45,7 @@ impl BlocklistLookupInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_blocklist_lookup_entry_by_merchant_id_fingerprint( &self, merchant_id: &str, @@ -57,6 +58,7 @@ impl BlocklistLookupInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_blocklist_lookup_entry_by_merchant_id_fingerprint( &self, merchant_id: &str, @@ -109,6 +111,7 @@ impl BlocklistLookupInterface for KafkaStore { .await } + #[instrument(skip_all)] async fn find_blocklist_lookup_entry_by_merchant_id_fingerprint( &self, merchant_id: &str, @@ -119,6 +122,7 @@ impl BlocklistLookupInterface for KafkaStore { .await } + #[instrument(skip_all)] async fn delete_blocklist_lookup_entry_by_merchant_id_fingerprint( &self, merchant_id: &str, diff --git a/crates/router/src/db/business_profile.rs b/crates/router/src/db/business_profile.rs index f29e0e9cec..e0e0046454 100644 --- a/crates/router/src/db/business_profile.rs +++ b/crates/router/src/db/business_profile.rs @@ -1,4 +1,5 @@ use error_stack::IntoReport; +use router_env::{instrument, tracing}; use super::Store; use crate::{ @@ -46,6 +47,7 @@ pub trait BusinessProfileInterface { #[async_trait::async_trait] impl BusinessProfileInterface for Store { + #[instrument(skip_all)] async fn insert_business_profile( &self, business_profile: business_profile::BusinessProfileNew, @@ -58,6 +60,7 @@ impl BusinessProfileInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_business_profile_by_profile_id( &self, profile_id: &str, @@ -69,6 +72,7 @@ impl BusinessProfileInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_business_profile_by_profile_name_merchant_id( &self, profile_name: &str, @@ -85,6 +89,7 @@ impl BusinessProfileInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_business_profile_by_profile_id( &self, current_state: business_profile::BusinessProfile, @@ -101,6 +106,7 @@ impl BusinessProfileInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_business_profile_by_profile_id_merchant_id( &self, profile_id: &str, @@ -117,6 +123,7 @@ impl BusinessProfileInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_business_profile_by_merchant_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/cache.rs b/crates/router/src/db/cache.rs index 4bda08e22c..7f2462b3fc 100644 --- a/crates/router/src/db/cache.rs +++ b/crates/router/src/db/cache.rs @@ -1,6 +1,7 @@ use common_utils::ext_traits::AsyncExt; use error_stack::ResultExt; use redis_interface::errors::RedisError; +use router_env::{instrument, tracing}; use storage_impl::redis::{ cache::{Cache, CacheKind, Cacheable}, pub_sub::PubSubInterface, @@ -12,6 +13,7 @@ use crate::{ core::errors::{self, CustomResult}, }; +#[instrument(skip_all)] pub async fn get_or_populate_redis( store: &dyn StorageInterface, key: impl AsRef, @@ -52,6 +54,7 @@ where } } +#[instrument(skip_all)] pub async fn get_or_populate_in_memory( store: &dyn StorageInterface, key: &str, @@ -73,6 +76,7 @@ where } } +#[instrument(skip_all)] pub async fn redact_cache( store: &dyn StorageInterface, key: &str, @@ -100,6 +104,7 @@ where Ok(data) } +#[instrument(skip_all)] pub async fn publish_into_redact_channel<'a, K: IntoIterator> + Send>( store: &dyn StorageInterface, keys: K, @@ -125,6 +130,7 @@ pub async fn publish_into_redact_channel<'a, K: IntoIterator()) } +#[instrument(skip_all)] pub async fn publish_and_redact<'a, T, F, Fut>( store: &dyn StorageInterface, key: CacheKind<'a>, @@ -139,6 +145,7 @@ where Ok(data) } +#[instrument(skip_all)] pub async fn publish_and_redact_multiple<'a, T, F, Fut, K>( store: &dyn StorageInterface, keys: K, diff --git a/crates/router/src/db/capture.rs b/crates/router/src/db/capture.rs index f9f60233a3..1373b45c2c 100644 --- a/crates/router/src/db/capture.rs +++ b/crates/router/src/db/capture.rs @@ -33,6 +33,7 @@ pub trait CaptureInterface { #[cfg(feature = "kv_store")] mod storage { use error_stack::IntoReport; + use router_env::{instrument, tracing}; use super::CaptureInterface; use crate::{ @@ -44,6 +45,7 @@ mod storage { #[async_trait::async_trait] impl CaptureInterface for Store { + #[instrument(skip_all)] async fn insert_capture( &self, capture: CaptureNew, @@ -60,6 +62,7 @@ mod storage { db_call().await } + #[instrument(skip_all)] async fn update_capture_with_capture_id( &self, this: Capture, @@ -76,6 +79,7 @@ mod storage { db_call().await } + #[instrument(skip_all)] async fn find_all_captures_by_merchant_id_payment_id_authorized_attempt_id( &self, merchant_id: &str, @@ -103,6 +107,7 @@ mod storage { #[cfg(not(feature = "kv_store"))] mod storage { use error_stack::IntoReport; + use router_env::{instrument, tracing}; use super::CaptureInterface; use crate::{ @@ -114,6 +119,7 @@ mod storage { #[async_trait::async_trait] impl CaptureInterface for Store { + #[instrument(skip_all)] async fn insert_capture( &self, capture: CaptureNew, @@ -130,6 +136,7 @@ mod storage { db_call().await } + #[instrument(skip_all)] async fn update_capture_with_capture_id( &self, this: Capture, @@ -146,6 +153,7 @@ mod storage { db_call().await } + #[instrument(skip_all)] async fn find_all_captures_by_merchant_id_payment_id_authorized_attempt_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/configs.rs b/crates/router/src/db/configs.rs index 1d472c1fb6..3f49254ae4 100644 --- a/crates/router/src/db/configs.rs +++ b/crates/router/src/db/configs.rs @@ -68,6 +68,7 @@ impl ConfigInterface for Store { config.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn update_config_in_database( &self, key: &str, @@ -81,6 +82,7 @@ impl ConfigInterface for Store { } //update in DB and remove in redis and cache + #[instrument(skip_all)] async fn update_config_by_key( &self, key: &str, @@ -92,6 +94,7 @@ impl ConfigInterface for Store { .await } + #[instrument(skip_all)] async fn find_config_by_key_from_db( &self, key: &str, @@ -104,6 +107,7 @@ impl ConfigInterface for Store { } //check in cache, then redis then finally DB, and on the way back populate redis and cache + #[instrument(skip_all)] async fn find_config_by_key( &self, key: &str, @@ -118,6 +122,7 @@ impl ConfigInterface for Store { cache::get_or_populate_in_memory(self, key, find_config_by_key_from_db, &CONFIG_CACHE).await } + #[instrument(skip_all)] async fn find_config_by_key_unwrap_or( &self, key: &str, @@ -157,6 +162,7 @@ impl ConfigInterface for Store { cache::get_or_populate_in_memory(self, key, find_else_unwrap_or, &CONFIG_CACHE).await } + #[instrument(skip_all)] async fn delete_config_by_key( &self, key: &str, diff --git a/crates/router/src/db/customers.rs b/crates/router/src/db/customers.rs index 68b4494120..9385e237e6 100644 --- a/crates/router/src/db/customers.rs +++ b/crates/router/src/db/customers.rs @@ -68,6 +68,7 @@ where #[async_trait::async_trait] impl CustomerInterface for Store { + #[instrument(skip_all)] async fn find_customer_optional_by_customer_id_merchant_id( &self, customer_id: &str, @@ -129,6 +130,7 @@ impl CustomerInterface for Store { .await } + #[instrument(skip_all)] async fn find_customer_by_customer_id_merchant_id( &self, customer_id: &str, @@ -155,6 +157,7 @@ impl CustomerInterface for Store { } } + #[instrument(skip_all)] async fn list_customers_by_merchant_id( &self, merchant_id: &str, @@ -180,6 +183,7 @@ impl CustomerInterface for Store { Ok(customers) } + #[instrument(skip_all)] async fn insert_customer( &self, customer_data: domain::Customer, @@ -202,6 +206,7 @@ impl CustomerInterface for Store { .await } + #[instrument(skip_all)] async fn delete_customer_by_customer_id_merchant_id( &self, customer_id: &str, diff --git a/crates/router/src/db/dashboard_metadata.rs b/crates/router/src/db/dashboard_metadata.rs index 49dd43313c..fee09870d5 100644 --- a/crates/router/src/db/dashboard_metadata.rs +++ b/crates/router/src/db/dashboard_metadata.rs @@ -1,5 +1,6 @@ use diesel_models::{enums, user::dashboard_metadata as storage}; use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use storage_impl::MockDb; use crate::{ @@ -55,6 +56,7 @@ pub trait DashboardMetadataInterface { #[async_trait::async_trait] impl DashboardMetadataInterface for Store { + #[instrument(skip_all)] async fn insert_metadata( &self, metadata: storage::DashboardMetadataNew, @@ -67,6 +69,7 @@ impl DashboardMetadataInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_metadata( &self, user_id: Option, @@ -89,6 +92,7 @@ impl DashboardMetadataInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_user_scoped_dashboard_metadata( &self, user_id: &str, @@ -109,6 +113,7 @@ impl DashboardMetadataInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_merchant_scoped_dashboard_metadata( &self, merchant_id: &str, @@ -126,6 +131,8 @@ impl DashboardMetadataInterface for Store { .map_err(Into::into) .into_report() } + + #[instrument(skip_all)] async fn delete_all_user_scoped_dashboard_metadata_by_merchant_id( &self, user_id: &str, @@ -142,6 +149,7 @@ impl DashboardMetadataInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_user_scoped_dashboard_metadata_by_merchant_id_data_key( &self, user_id: &str, diff --git a/crates/router/src/db/dispute.rs b/crates/router/src/db/dispute.rs index 4529b121fa..0c34123b6f 100644 --- a/crates/router/src/db/dispute.rs +++ b/crates/router/src/db/dispute.rs @@ -1,4 +1,5 @@ use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -48,6 +49,7 @@ pub trait DisputeInterface { #[async_trait::async_trait] impl DisputeInterface for Store { + #[instrument(skip_all)] async fn insert_dispute( &self, dispute: storage::DisputeNew, @@ -60,6 +62,7 @@ impl DisputeInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_by_merchant_id_payment_id_connector_dispute_id( &self, merchant_id: &str, @@ -78,6 +81,7 @@ impl DisputeInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_dispute_by_merchant_id_dispute_id( &self, merchant_id: &str, @@ -90,6 +94,7 @@ impl DisputeInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_disputes_by_merchant_id( &self, merchant_id: &str, @@ -102,6 +107,7 @@ impl DisputeInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_disputes_by_merchant_id_payment_id( &self, merchant_id: &str, @@ -114,6 +120,7 @@ impl DisputeInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_dispute( &self, this: storage::Dispute, diff --git a/crates/router/src/db/ephemeral_key.rs b/crates/router/src/db/ephemeral_key.rs index 9b7936ef2a..a1d43e83b8 100644 --- a/crates/router/src/db/ephemeral_key.rs +++ b/crates/router/src/db/ephemeral_key.rs @@ -27,6 +27,7 @@ mod storage { use common_utils::date_time; use error_stack::ResultExt; use redis_interface::HsetnxReply; + use router_env::{instrument, tracing}; use storage_impl::redis::kv_store::RedisConnInterface; use time::ext::NumericalDuration; @@ -39,6 +40,7 @@ mod storage { #[async_trait::async_trait] impl EphemeralKeyInterface for Store { + #[instrument(skip_all)] async fn create_ephemeral_key( &self, new: EphemeralKeyNew, @@ -92,6 +94,7 @@ mod storage { Err(er) => Err(er).change_context(errors::StorageError::KVError), } } + #[instrument(skip_all)] async fn get_ephemeral_key( &self, key: &str, diff --git a/crates/router/src/db/events.rs b/crates/router/src/db/events.rs index 3d87fc70ea..af99d6a8e3 100644 --- a/crates/router/src/db/events.rs +++ b/crates/router/src/db/events.rs @@ -1,4 +1,5 @@ use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -22,6 +23,7 @@ pub trait EventInterface { #[async_trait::async_trait] impl EventInterface for Store { + #[instrument(skip_all)] async fn insert_event( &self, event: storage::EventNew, @@ -29,6 +31,7 @@ impl EventInterface for Store { let conn = connection::pg_connection_write(self).await?; event.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn update_event( &self, event_id: String, diff --git a/crates/router/src/db/file.rs b/crates/router/src/db/file.rs index 5ed8f22a2f..ffd18336ef 100644 --- a/crates/router/src/db/file.rs +++ b/crates/router/src/db/file.rs @@ -1,4 +1,5 @@ use error_stack::IntoReport; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -35,6 +36,7 @@ pub trait FileMetadataInterface { #[async_trait::async_trait] impl FileMetadataInterface for Store { + #[instrument(skip_all)] async fn insert_file_metadata( &self, file: storage::FileMetadataNew, @@ -43,6 +45,7 @@ impl FileMetadataInterface for Store { file.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn find_file_metadata_by_merchant_id_file_id( &self, merchant_id: &str, @@ -55,6 +58,7 @@ impl FileMetadataInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_file_metadata_by_merchant_id_file_id( &self, merchant_id: &str, @@ -67,6 +71,7 @@ impl FileMetadataInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_file_metadata( &self, this: storage::FileMetadata, diff --git a/crates/router/src/db/fraud_check.rs b/crates/router/src/db/fraud_check.rs index 2d107766c7..656cac0adb 100644 --- a/crates/router/src/db/fraud_check.rs +++ b/crates/router/src/db/fraud_check.rs @@ -1,5 +1,6 @@ use diesel_models::fraud_check::{self as storage, FraudCheck, FraudCheckUpdate}; use error_stack::IntoReport; +use router_env::{instrument, tracing}; use super::MockDb; use crate::{ @@ -36,6 +37,7 @@ pub trait FraudCheckInterface { #[async_trait::async_trait] impl FraudCheckInterface for Store { + #[instrument(skip_all)] async fn insert_fraud_check_response( &self, new: storage::FraudCheckNew, @@ -43,6 +45,8 @@ impl FraudCheckInterface for Store { let conn = connection::pg_connection_write(self).await?; new.insert(&conn).await.map_err(Into::into).into_report() } + + #[instrument(skip_all)] async fn update_fraud_check_response_with_attempt_id( &self, this: FraudCheck, @@ -54,6 +58,8 @@ impl FraudCheckInterface for Store { .map_err(Into::into) .into_report() } + + #[instrument(skip_all)] async fn find_fraud_check_by_payment_id( &self, payment_id: String, @@ -66,6 +72,7 @@ impl FraudCheckInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_fraud_check_by_payment_id_if_present( &self, payment_id: String, @@ -114,12 +121,15 @@ impl FraudCheckInterface for MockDb { #[cfg(feature = "kafka_events")] #[async_trait::async_trait] impl FraudCheckInterface for super::KafkaStore { + #[instrument(skip_all)] async fn insert_fraud_check_response( &self, _new: storage::FraudCheckNew, ) -> CustomResult { Err(errors::StorageError::MockDbError)? } + + #[instrument(skip_all)] async fn update_fraud_check_response_with_attempt_id( &self, _this: FraudCheck, @@ -128,6 +138,7 @@ impl FraudCheckInterface for super::KafkaStore { Err(errors::StorageError::MockDbError)? } + #[instrument(skip_all)] async fn find_fraud_check_by_payment_id( &self, _payment_id: String, diff --git a/crates/router/src/db/gsm.rs b/crates/router/src/db/gsm.rs index b623bdc2bc..4a9cf651d2 100644 --- a/crates/router/src/db/gsm.rs +++ b/crates/router/src/db/gsm.rs @@ -1,5 +1,6 @@ use diesel_models::gsm as storage; use error_stack::IntoReport; +use router_env::{instrument, tracing}; use super::MockDb; use crate::{ @@ -52,6 +53,7 @@ pub trait GsmInterface { #[async_trait::async_trait] impl GsmInterface for Store { + #[instrument(skip_all)] async fn add_gsm_rule( &self, rule: storage::GatewayStatusMappingNew, @@ -60,6 +62,7 @@ impl GsmInterface for Store { rule.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn find_gsm_decision( &self, connector: String, @@ -77,6 +80,7 @@ impl GsmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_gsm_rule( &self, connector: String, @@ -92,6 +96,7 @@ impl GsmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_gsm_rule( &self, connector: String, @@ -108,6 +113,7 @@ impl GsmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_gsm_rule( &self, connector: String, diff --git a/crates/router/src/db/health_check.rs b/crates/router/src/db/health_check.rs index 6ebc9dfff5..5423fef955 100644 --- a/crates/router/src/db/health_check.rs +++ b/crates/router/src/db/health_check.rs @@ -1,7 +1,7 @@ use async_bb8_diesel::{AsyncConnection, AsyncRunQueryDsl}; use diesel_models::ConfigNew; use error_stack::ResultExt; -use router_env::logger; +use router_env::{instrument, logger, tracing}; use super::{MockDb, Store}; use crate::{ @@ -17,6 +17,7 @@ pub trait HealthCheckDbInterface { #[async_trait::async_trait] impl HealthCheckDbInterface for Store { + #[instrument(skip_all)] async fn health_check_db(&self) -> CustomResult<(), errors::HealthCheckDBError> { let conn = connection::pg_connection_write(self) .await diff --git a/crates/router/src/db/locker_mock_up.rs b/crates/router/src/db/locker_mock_up.rs index ca3028486b..d70c6baa81 100644 --- a/crates/router/src/db/locker_mock_up.rs +++ b/crates/router/src/db/locker_mock_up.rs @@ -1,4 +1,5 @@ use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -27,6 +28,7 @@ pub trait LockerMockUpInterface { #[async_trait::async_trait] impl LockerMockUpInterface for Store { + #[instrument(skip_all)] async fn find_locker_by_card_id( &self, card_id: &str, @@ -38,6 +40,7 @@ impl LockerMockUpInterface for Store { .into_report() } + #[instrument(skip_all)] async fn insert_locker_mock_up( &self, new: storage::LockerMockUpNew, @@ -46,6 +49,7 @@ impl LockerMockUpInterface for Store { new.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn delete_locker_mock_up( &self, card_id: &str, diff --git a/crates/router/src/db/mandate.rs b/crates/router/src/db/mandate.rs index 0cf5cabf2e..eb2859e57e 100644 --- a/crates/router/src/db/mandate.rs +++ b/crates/router/src/db/mandate.rs @@ -1,4 +1,5 @@ use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -48,6 +49,7 @@ pub trait MandateInterface { #[async_trait::async_trait] impl MandateInterface for Store { + #[instrument(skip_all)] async fn find_mandate_by_merchant_id_mandate_id( &self, merchant_id: &str, @@ -60,6 +62,7 @@ impl MandateInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_mandate_by_merchant_id_connector_mandate_id( &self, merchant_id: &str, @@ -76,6 +79,7 @@ impl MandateInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_mandate_by_merchant_id_customer_id( &self, merchant_id: &str, @@ -88,6 +92,7 @@ impl MandateInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_mandate_by_merchant_id_mandate_id( &self, merchant_id: &str, @@ -101,6 +106,7 @@ impl MandateInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_mandates_by_merchant_id( &self, merchant_id: &str, @@ -113,6 +119,7 @@ impl MandateInterface for Store { .into_report() } + #[instrument(skip_all)] async fn insert_mandate( &self, mandate: storage::MandateNew, diff --git a/crates/router/src/db/merchant_account.rs b/crates/router/src/db/merchant_account.rs index 70d417c036..3ecf897148 100644 --- a/crates/router/src/db/merchant_account.rs +++ b/crates/router/src/db/merchant_account.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; use common_utils::ext_traits::AsyncExt; use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; #[cfg(feature = "accounts_cache")] use storage_impl::redis::cache::{CacheKind, ACCOUNTS_CACHE}; @@ -78,6 +79,7 @@ where #[async_trait::async_trait] impl MerchantAccountInterface for Store { + #[instrument(skip_all)] async fn insert_merchant( &self, merchant_account: domain::MerchantAccount, @@ -97,6 +99,7 @@ impl MerchantAccountInterface for Store { .change_context(errors::StorageError::DecryptionError) } + #[instrument(skip_all)] async fn find_merchant_account_by_merchant_id( &self, merchant_id: &str, @@ -129,6 +132,7 @@ impl MerchantAccountInterface for Store { } } + #[instrument(skip_all)] async fn update_merchant( &self, this: domain::MerchantAccount, @@ -155,6 +159,7 @@ impl MerchantAccountInterface for Store { .change_context(errors::StorageError::DecryptionError) } + #[instrument(skip_all)] async fn update_specific_fields_in_merchant( &self, merchant_id: &str, @@ -181,6 +186,7 @@ impl MerchantAccountInterface for Store { .change_context(errors::StorageError::DecryptionError) } + #[instrument(skip_all)] async fn find_merchant_account_by_publishable_key( &self, publishable_key: &str, @@ -228,6 +234,7 @@ impl MerchantAccountInterface for Store { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn list_merchant_accounts_by_organization_id( &self, organization_id: &str, @@ -268,6 +275,7 @@ impl MerchantAccountInterface for Store { Ok(merchant_accounts) } + #[instrument(skip_all)] async fn delete_merchant_account_by_merchant_id( &self, merchant_id: &str, @@ -305,6 +313,7 @@ impl MerchantAccountInterface for Store { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn list_multiple_merchant_accounts( &self, merchant_ids: Vec, diff --git a/crates/router/src/db/merchant_connector_account.rs b/crates/router/src/db/merchant_connector_account.rs index d01c4f3784..e4cad30ec2 100644 --- a/crates/router/src/db/merchant_connector_account.rs +++ b/crates/router/src/db/merchant_connector_account.rs @@ -1,5 +1,6 @@ use common_utils::ext_traits::{AsyncExt, ByteSliceExt, Encode}; use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; #[cfg(feature = "accounts_cache")] use storage_impl::redis::cache; use storage_impl::redis::kv_store::RedisConnInterface; @@ -36,6 +37,7 @@ pub trait ConnectorAccessToken { #[async_trait::async_trait] impl ConnectorAccessToken for Store { + #[instrument(skip_all)] async fn get_access_token( &self, merchant_id: &str, @@ -62,6 +64,7 @@ impl ConnectorAccessToken for Store { Ok(access_token) } + #[instrument(skip_all)] async fn set_access_token( &self, merchant_id: &str, @@ -165,6 +168,7 @@ where #[async_trait::async_trait] impl MerchantConnectorAccountInterface for Store { + #[instrument(skip_all)] async fn find_merchant_connector_account_by_merchant_id_connector_label( &self, merchant_id: &str, @@ -210,6 +214,7 @@ impl MerchantConnectorAccountInterface for Store { } } + #[instrument(skip_all)] async fn find_merchant_connector_account_by_profile_id_connector_name( &self, profile_id: &str, @@ -255,6 +260,7 @@ impl MerchantConnectorAccountInterface for Store { } } + #[instrument(skip_all)] async fn find_merchant_connector_account_by_merchant_id_connector_name( &self, merchant_id: &str, @@ -284,6 +290,7 @@ impl MerchantConnectorAccountInterface for Store { .await } + #[instrument(skip_all)] async fn find_by_merchant_connector_account_merchant_id_merchant_connector_id( &self, merchant_id: &str, @@ -326,6 +333,7 @@ impl MerchantConnectorAccountInterface for Store { } } + #[instrument(skip_all)] async fn insert_merchant_connector_account( &self, t: domain::MerchantConnectorAccount, @@ -347,6 +355,7 @@ impl MerchantConnectorAccountInterface for Store { .await } + #[instrument(skip_all)] async fn find_merchant_connector_account_by_merchant_id_and_disabled_list( &self, merchant_id: &str, @@ -372,6 +381,7 @@ impl MerchantConnectorAccountInterface for Store { .await } + #[instrument(skip_all)] async fn update_merchant_connector_account( &self, this: domain::MerchantConnectorAccount, @@ -430,6 +440,7 @@ impl MerchantConnectorAccountInterface for Store { } } + #[instrument(skip_all)] async fn delete_merchant_connector_account_by_merchant_id_merchant_connector_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/merchant_key_store.rs b/crates/router/src/db/merchant_key_store.rs index 630b833afd..e3d81302cb 100644 --- a/crates/router/src/db/merchant_key_store.rs +++ b/crates/router/src/db/merchant_key_store.rs @@ -1,5 +1,6 @@ use error_stack::{IntoReport, ResultExt}; use masking::Secret; +use router_env::{instrument, tracing}; #[cfg(feature = "accounts_cache")] use storage_impl::redis::cache::{CacheKind, ACCOUNTS_CACHE}; @@ -43,6 +44,7 @@ pub trait MerchantKeyStoreInterface { #[async_trait::async_trait] impl MerchantKeyStoreInterface for Store { + #[instrument(skip_all)] async fn insert_merchant_key_store( &self, merchant_key_store: domain::MerchantKeyStore, @@ -62,6 +64,7 @@ impl MerchantKeyStoreInterface for Store { .change_context(errors::StorageError::DecryptionError) } + #[instrument(skip_all)] async fn get_merchant_key_store_by_merchant_id( &self, merchant_id: &str, @@ -104,6 +107,7 @@ impl MerchantKeyStoreInterface for Store { } } + #[instrument(skip_all)] async fn delete_merchant_key_store_by_merchant_id( &self, merchant_id: &str, @@ -137,6 +141,7 @@ impl MerchantKeyStoreInterface for Store { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn list_multiple_key_stores( &self, merchant_ids: Vec, diff --git a/crates/router/src/db/organization.rs b/crates/router/src/db/organization.rs index ddb8d9f9d9..63e4a0e8cd 100644 --- a/crates/router/src/db/organization.rs +++ b/crates/router/src/db/organization.rs @@ -1,6 +1,7 @@ use common_utils::errors::CustomResult; use diesel_models::organization as storage; use error_stack::IntoReport; +use router_env::{instrument, tracing}; use crate::{connection, core::errors, services::Store}; @@ -25,6 +26,7 @@ pub trait OrganizationInterface { #[async_trait::async_trait] impl OrganizationInterface for Store { + #[instrument(skip_all)] async fn insert_organization( &self, organization: storage::OrganizationNew, @@ -37,6 +39,7 @@ impl OrganizationInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_organization_by_org_id( &self, org_id: &str, @@ -48,6 +51,7 @@ impl OrganizationInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_organization_by_org_id( &self, org_id: &str, diff --git a/crates/router/src/db/payment_link.rs b/crates/router/src/db/payment_link.rs index a56f9dcce2..1a85de9e88 100644 --- a/crates/router/src/db/payment_link.rs +++ b/crates/router/src/db/payment_link.rs @@ -1,4 +1,5 @@ use error_stack::IntoReport; +use router_env::{instrument, tracing}; use crate::{ connection, @@ -29,6 +30,7 @@ pub trait PaymentLinkInterface { #[async_trait::async_trait] impl PaymentLinkInterface for Store { + #[instrument(skip_all)] async fn find_payment_link_by_payment_link_id( &self, payment_link_id: &str, @@ -40,6 +42,7 @@ impl PaymentLinkInterface for Store { .into_report() } + #[instrument(skip_all)] async fn insert_payment_link( &self, payment_link_config: storage::PaymentLinkNew, @@ -52,6 +55,7 @@ impl PaymentLinkInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_payment_link_by_merchant_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/payment_method.rs b/crates/router/src/db/payment_method.rs index ddd2857cc2..ef471fbd24 100644 --- a/crates/router/src/db/payment_method.rs +++ b/crates/router/src/db/payment_method.rs @@ -1,5 +1,6 @@ use diesel_models::payment_method::PaymentMethodUpdateInternal; use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -55,6 +56,7 @@ pub trait PaymentMethodInterface { #[async_trait::async_trait] impl PaymentMethodInterface for Store { + #[instrument(skip_all)] async fn find_payment_method( &self, payment_method_id: &str, @@ -66,6 +68,7 @@ impl PaymentMethodInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_payment_method_by_locker_id( &self, locker_id: &str, @@ -77,6 +80,7 @@ impl PaymentMethodInterface for Store { .into_report() } + #[instrument(skip_all)] async fn insert_payment_method( &self, payment_method_new: storage::PaymentMethodNew, @@ -89,6 +93,7 @@ impl PaymentMethodInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_payment_method( &self, payment_method: storage::PaymentMethod, @@ -102,6 +107,7 @@ impl PaymentMethodInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_payment_method_by_customer_id_merchant_id_list( &self, customer_id: &str, @@ -120,6 +126,7 @@ impl PaymentMethodInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_payment_method_by_customer_id_merchant_id_status( &self, customer_id: &str, diff --git a/crates/router/src/db/payout_attempt.rs b/crates/router/src/db/payout_attempt.rs index 1e46393458..0e327eaa14 100644 --- a/crates/router/src/db/payout_attempt.rs +++ b/crates/router/src/db/payout_attempt.rs @@ -1,4 +1,5 @@ use error_stack::IntoReport; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -43,6 +44,7 @@ pub trait PayoutAttemptInterface { #[async_trait::async_trait] impl PayoutAttemptInterface for Store { + #[instrument(skip_all)] async fn find_payout_attempt_by_merchant_id_payout_id( &self, merchant_id: &str, @@ -55,6 +57,7 @@ impl PayoutAttemptInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_payout_attempt_by_merchant_id_payout_attempt_id( &self, merchant_id: &str, @@ -71,6 +74,7 @@ impl PayoutAttemptInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_payout_attempt_by_merchant_id_payout_id( &self, merchant_id: &str, @@ -89,6 +93,7 @@ impl PayoutAttemptInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_payout_attempt_by_merchant_id_payout_attempt_id( &self, merchant_id: &str, @@ -107,6 +112,7 @@ impl PayoutAttemptInterface for Store { .into_report() } + #[instrument(skip_all)] async fn insert_payout_attempt( &self, payout: storage::PayoutAttemptNew, diff --git a/crates/router/src/db/payouts.rs b/crates/router/src/db/payouts.rs index cd9c50217b..b20441de0f 100644 --- a/crates/router/src/db/payouts.rs +++ b/crates/router/src/db/payouts.rs @@ -1,4 +1,5 @@ use error_stack::IntoReport; +use router_env::{instrument, tracing}; use super::{MockDb, Store}; use crate::{ @@ -30,6 +31,7 @@ pub trait PayoutsInterface { #[async_trait::async_trait] impl PayoutsInterface for Store { + #[instrument(skip_all)] async fn find_payout_by_merchant_id_payout_id( &self, merchant_id: &str, @@ -42,6 +44,7 @@ impl PayoutsInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_payout_by_merchant_id_payout_id( &self, merchant_id: &str, @@ -55,6 +58,7 @@ impl PayoutsInterface for Store { .into_report() } + #[instrument(skip_all)] async fn insert_payout( &self, payout: storage::PayoutsNew, diff --git a/crates/router/src/db/refund.rs b/crates/router/src/db/refund.rs index 9664c29eed..cc2d7e8b7b 100644 --- a/crates/router/src/db/refund.rs +++ b/crates/router/src/db/refund.rs @@ -94,6 +94,7 @@ pub trait RefundInterface { #[cfg(not(feature = "kv_store"))] mod storage { use error_stack::IntoReport; + use router_env::{instrument, tracing}; use super::RefundInterface; use crate::{ @@ -105,6 +106,7 @@ mod storage { #[async_trait::async_trait] impl RefundInterface for Store { + #[instrument(skip_all)] async fn find_refund_by_internal_reference_id_merchant_id( &self, internal_reference_id: &str, @@ -122,6 +124,7 @@ mod storage { .into_report() } + #[instrument(skip_all)] async fn insert_refund( &self, new: storage_types::RefundNew, @@ -131,6 +134,7 @@ mod storage { new.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn find_refund_by_merchant_id_connector_transaction_id( &self, merchant_id: &str, @@ -148,6 +152,7 @@ mod storage { .into_report() } + #[instrument(skip_all)] async fn update_refund( &self, this: storage_types::Refund, @@ -161,6 +166,7 @@ mod storage { .into_report() } + #[instrument(skip_all)] async fn find_refund_by_merchant_id_refund_id( &self, merchant_id: &str, @@ -174,6 +180,7 @@ mod storage { .into_report() } + #[instrument(skip_all)] async fn find_refund_by_merchant_id_connector_refund_id_connector( &self, merchant_id: &str, @@ -193,6 +200,7 @@ mod storage { .into_report() } + #[instrument(skip_all)] async fn find_refund_by_payment_id_merchant_id( &self, payment_id: &str, @@ -207,6 +215,7 @@ mod storage { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn filter_refund_by_constraints( &self, merchant_id: &str, @@ -229,6 +238,7 @@ mod storage { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn filter_refund_by_meta_constraints( &self, merchant_id: &str, @@ -246,6 +256,7 @@ mod storage { .into_report() } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn get_total_count_of_refunds( &self, merchant_id: &str, @@ -270,6 +281,7 @@ mod storage { use common_utils::{date_time, ext_traits::Encode, fallback_reverse_lookup_not_found}; use error_stack::{IntoReport, ResultExt}; use redis_interface::HsetnxReply; + use router_env::{instrument, tracing}; use storage_impl::redis::kv_store::{kv_wrapper, KvOperation}; use super::RefundInterface; @@ -283,6 +295,7 @@ mod storage { }; #[async_trait::async_trait] impl RefundInterface for Store { + #[instrument(skip_all)] async fn find_refund_by_internal_reference_id_merchant_id( &self, internal_reference_id: &str, @@ -328,6 +341,7 @@ mod storage { } } + #[instrument(skip_all)] async fn insert_refund( &self, new: storage_types::RefundNew, @@ -452,6 +466,7 @@ mod storage { } } + #[instrument(skip_all)] async fn find_refund_by_merchant_id_connector_transaction_id( &self, merchant_id: &str, @@ -501,6 +516,7 @@ mod storage { } } + #[instrument(skip_all)] async fn update_refund( &self, this: storage_types::Refund, @@ -551,6 +567,7 @@ mod storage { } } + #[instrument(skip_all)] async fn find_refund_by_merchant_id_refund_id( &self, merchant_id: &str, @@ -592,6 +609,7 @@ mod storage { } } + #[instrument(skip_all)] async fn find_refund_by_merchant_id_connector_refund_id_connector( &self, merchant_id: &str, @@ -640,6 +658,7 @@ mod storage { } } + #[instrument(skip_all)] async fn find_refund_by_payment_id_merchant_id( &self, payment_id: &str, @@ -679,6 +698,7 @@ mod storage { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn filter_refund_by_constraints( &self, merchant_id: &str, @@ -701,6 +721,7 @@ mod storage { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn filter_refund_by_meta_constraints( &self, merchant_id: &str, @@ -715,6 +736,7 @@ mod storage { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn get_total_count_of_refunds( &self, merchant_id: &str, diff --git a/crates/router/src/db/reverse_lookup.rs b/crates/router/src/db/reverse_lookup.rs index 344077f3ec..ccb77571cf 100644 --- a/crates/router/src/db/reverse_lookup.rs +++ b/crates/router/src/db/reverse_lookup.rs @@ -24,6 +24,7 @@ pub trait ReverseLookupInterface { #[cfg(not(feature = "kv_store"))] mod storage { use error_stack::IntoReport; + use router_env::{instrument, tracing}; use super::{ReverseLookupInterface, Store}; use crate::{ @@ -37,6 +38,7 @@ mod storage { #[async_trait::async_trait] impl ReverseLookupInterface for Store { + #[instrument(skip_all)] async fn insert_reverse_lookup( &self, new: ReverseLookupNew, @@ -46,6 +48,7 @@ mod storage { new.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn get_lookup_by_lookup_id( &self, id: &str, @@ -64,6 +67,7 @@ mod storage { mod storage { use error_stack::{IntoReport, ResultExt}; use redis_interface::SetnxReply; + use router_env::{instrument, tracing}; use storage_impl::redis::kv_store::{kv_wrapper, KvOperation}; use super::{ReverseLookupInterface, Store}; @@ -80,6 +84,7 @@ mod storage { #[async_trait::async_trait] impl ReverseLookupInterface for Store { + #[instrument(skip_all)] async fn insert_reverse_lookup( &self, new: ReverseLookupNew, @@ -125,6 +130,7 @@ mod storage { } } + #[instrument(skip_all)] async fn get_lookup_by_lookup_id( &self, id: &str, diff --git a/crates/router/src/db/role.rs b/crates/router/src/db/role.rs index 111b531e2f..c8777e3112 100644 --- a/crates/router/src/db/role.rs +++ b/crates/router/src/db/role.rs @@ -1,6 +1,7 @@ use common_enums::enums; use diesel_models::role as storage; use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use super::MockDb; use crate::{ @@ -48,6 +49,7 @@ pub trait RoleInterface { #[async_trait::async_trait] impl RoleInterface for Store { + #[instrument(skip_all)] async fn insert_role( &self, role: storage::RoleNew, @@ -56,6 +58,7 @@ impl RoleInterface for Store { role.insert(&conn).await.map_err(Into::into).into_report() } + #[instrument(skip_all)] async fn find_role_by_role_id( &self, role_id: &str, @@ -67,6 +70,7 @@ impl RoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_role_by_role_id_in_merchant_scope( &self, role_id: &str, @@ -80,6 +84,7 @@ impl RoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_role_by_role_id( &self, role_id: &str, @@ -92,6 +97,7 @@ impl RoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_role_by_role_id( &self, role_id: &str, @@ -103,6 +109,7 @@ impl RoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_all_roles( &self, merchant_id: &str, diff --git a/crates/router/src/db/routing_algorithm.rs b/crates/router/src/db/routing_algorithm.rs index 9970d1d9c9..e0f74358b9 100644 --- a/crates/router/src/db/routing_algorithm.rs +++ b/crates/router/src/db/routing_algorithm.rs @@ -1,5 +1,6 @@ use diesel_models::routing_algorithm as routing_storage; use error_stack::IntoReport; +use router_env::{instrument, tracing}; use storage_impl::mock_db::MockDb; use crate::{ @@ -60,6 +61,7 @@ pub trait RoutingAlgorithmInterface { #[async_trait::async_trait] impl RoutingAlgorithmInterface for Store { + #[instrument(skip_all)] async fn insert_routing_algorithm( &self, routing_algorithm: routing_storage::RoutingAlgorithm, @@ -72,6 +74,7 @@ impl RoutingAlgorithmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_routing_algorithm_by_profile_id_algorithm_id( &self, profile_id: &str, @@ -88,6 +91,7 @@ impl RoutingAlgorithmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_routing_algorithm_by_algorithm_id_merchant_id( &self, algorithm_id: &str, @@ -104,6 +108,7 @@ impl RoutingAlgorithmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_routing_algorithm_metadata_by_algorithm_id_profile_id( &self, algorithm_id: &str, @@ -120,6 +125,7 @@ impl RoutingAlgorithmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_routing_algorithm_metadata_by_profile_id( &self, profile_id: &str, @@ -135,6 +141,7 @@ impl RoutingAlgorithmInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_routing_algorithm_metadata_by_merchant_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/user.rs b/crates/router/src/db/user.rs index c7c005a0b5..6148e67b29 100644 --- a/crates/router/src/db/user.rs +++ b/crates/router/src/db/user.rs @@ -1,6 +1,7 @@ use diesel_models::{user as storage, user_role::UserRole}; use error_stack::{IntoReport, ResultExt}; use masking::Secret; +use router_env::{instrument, tracing}; use super::MockDb; use crate::{ @@ -52,6 +53,7 @@ pub trait UserInterface { #[async_trait::async_trait] impl UserInterface for Store { + #[instrument(skip_all)] async fn insert_user( &self, user_data: storage::UserNew, @@ -64,6 +66,7 @@ impl UserInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_user_by_email( &self, user_email: &str, @@ -75,6 +78,7 @@ impl UserInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_user_by_id( &self, user_id: &str, @@ -86,6 +90,7 @@ impl UserInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_user_by_user_id( &self, user_id: &str, @@ -98,6 +103,7 @@ impl UserInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_user_by_email( &self, user_email: &str, @@ -110,6 +116,7 @@ impl UserInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_user_by_user_id( &self, user_id: &str, @@ -121,6 +128,7 @@ impl UserInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_users_and_roles_by_merchant_id( &self, merchant_id: &str, diff --git a/crates/router/src/db/user_role.rs b/crates/router/src/db/user_role.rs index 12816fa006..ae2c85db04 100644 --- a/crates/router/src/db/user_role.rs +++ b/crates/router/src/db/user_role.rs @@ -3,6 +3,7 @@ use std::{collections::HashSet, ops::Not}; use async_bb8_diesel::AsyncConnection; use diesel_models::{enums, user_role as storage}; use error_stack::{IntoReport, ResultExt}; +use router_env::{instrument, tracing}; use super::MockDb; use crate::{ @@ -64,6 +65,7 @@ pub trait UserRoleInterface { #[async_trait::async_trait] impl UserRoleInterface for Store { + #[instrument(skip_all)] async fn insert_user_role( &self, user_role: storage::UserRoleNew, @@ -76,6 +78,7 @@ impl UserRoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_user_role_by_user_id( &self, user_id: &str, @@ -87,6 +90,7 @@ impl UserRoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn find_user_role_by_user_id_merchant_id( &self, user_id: &str, @@ -103,6 +107,7 @@ impl UserRoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_user_role_by_user_id_merchant_id( &self, user_id: &str, @@ -121,6 +126,7 @@ impl UserRoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn update_user_roles_by_user_id_org_id( &self, user_id: &str, @@ -139,6 +145,7 @@ impl UserRoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn delete_user_role_by_user_id_merchant_id( &self, user_id: &str, @@ -155,6 +162,7 @@ impl UserRoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn list_user_roles_by_user_id( &self, user_id: &str, @@ -166,6 +174,7 @@ impl UserRoleInterface for Store { .into_report() } + #[instrument(skip_all)] async fn transfer_org_ownership_between_users( &self, from_user_id: &str, diff --git a/crates/storage_impl/src/payments/payment_attempt.rs b/crates/storage_impl/src/payments/payment_attempt.rs index a51f95e1e7..aff792636d 100644 --- a/crates/storage_impl/src/payments/payment_attempt.rs +++ b/crates/storage_impl/src/payments/payment_attempt.rs @@ -74,6 +74,7 @@ impl PaymentAttemptInterface for RouterStore { .map(PaymentAttempt::from_storage_model) } + #[instrument(skip_all)] async fn find_payment_attempt_by_connector_transaction_id_payment_id_merchant_id( &self, connector_transaction_id: &str, @@ -96,6 +97,7 @@ impl PaymentAttemptInterface for RouterStore { .map(PaymentAttempt::from_storage_model) } + #[instrument(skip_all)] async fn find_payment_attempt_last_successful_attempt_by_payment_id_merchant_id( &self, payment_id: &str, @@ -137,6 +139,7 @@ impl PaymentAttemptInterface for RouterStore { .map(PaymentAttempt::from_storage_model) } + #[instrument(skip_all)] async fn find_payment_attempt_by_merchant_id_connector_txn_id( &self, merchant_id: &str, @@ -181,6 +184,7 @@ impl PaymentAttemptInterface for RouterStore { .map(PaymentAttempt::from_storage_model) } + #[instrument(skip_all)] async fn get_filters_for_payments( &self, pi: &[PaymentIntent], @@ -218,6 +222,7 @@ impl PaymentAttemptInterface for RouterStore { ) } + #[instrument(skip_all)] async fn find_payment_attempt_by_preprocessing_id_merchant_id( &self, preprocessing_id: &str, @@ -239,6 +244,7 @@ impl PaymentAttemptInterface for RouterStore { .map(PaymentAttempt::from_storage_model) } + #[instrument(skip_all)] async fn find_attempts_by_merchant_id_payment_id( &self, merchant_id: &str, @@ -259,6 +265,7 @@ impl PaymentAttemptInterface for RouterStore { }) } + #[instrument(skip_all)] async fn find_payment_attempt_by_attempt_id_merchant_id( &self, attempt_id: &str, @@ -276,6 +283,7 @@ impl PaymentAttemptInterface for RouterStore { .map(PaymentAttempt::from_storage_model) } + #[instrument(skip_all)] async fn get_total_count_of_filtered_payment_attempts( &self, merchant_id: &str, @@ -557,6 +565,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn find_payment_attempt_by_connector_transaction_id_payment_id_merchant_id( &self, connector_transaction_id: &str, @@ -604,6 +613,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn find_payment_attempt_last_successful_attempt_by_payment_id_merchant_id( &self, payment_id: &str, @@ -652,6 +662,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id_merchant_id( &self, payment_id: &str, @@ -703,6 +714,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn find_payment_attempt_by_merchant_id_connector_txn_id( &self, merchant_id: &str, @@ -803,6 +815,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn find_payment_attempt_by_attempt_id_merchant_id( &self, attempt_id: &str, @@ -859,6 +872,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn find_payment_attempt_by_preprocessing_id_merchant_id( &self, preprocessing_id: &str, @@ -915,6 +929,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn find_attempts_by_merchant_id_payment_id( &self, merchant_id: &str, @@ -954,6 +969,7 @@ impl PaymentAttemptInterface for KVRouterStore { } } + #[instrument(skip_all)] async fn get_filters_for_payments( &self, pi: &[PaymentIntent], @@ -965,6 +981,7 @@ impl PaymentAttemptInterface for KVRouterStore { .await } + #[instrument(skip_all)] async fn get_total_count_of_filtered_payment_attempts( &self, merchant_id: &str, @@ -1855,6 +1872,7 @@ impl DataModelExt for PaymentAttemptUpdate { } #[inline] +#[instrument(skip_all)] async fn add_connector_txn_id_to_reverse_lookup( store: &KVRouterStore, key: &str, @@ -1877,6 +1895,7 @@ async fn add_connector_txn_id_to_reverse_lookup( } #[inline] +#[instrument(skip_all)] async fn add_preprocessing_id_to_reverse_lookup( store: &KVRouterStore, key: &str, diff --git a/crates/storage_impl/src/payments/payment_intent.rs b/crates/storage_impl/src/payments/payment_intent.rs index d201d2a053..1dc0b1f90f 100644 --- a/crates/storage_impl/src/payments/payment_intent.rs +++ b/crates/storage_impl/src/payments/payment_intent.rs @@ -316,6 +316,7 @@ impl PaymentIntentInterface for KVRouterStore { #[async_trait::async_trait] impl PaymentIntentInterface for crate::RouterStore { + #[instrument(skip_all)] async fn insert_payment_intent( &self, new: PaymentIntentNew, @@ -332,6 +333,7 @@ impl PaymentIntentInterface for crate::RouterStore { .map(PaymentIntent::from_storage_model) } + #[instrument(skip_all)] async fn update_payment_intent( &self, this: PaymentIntent, @@ -366,6 +368,7 @@ impl PaymentIntentInterface for crate::RouterStore { }) } + #[instrument(skip_all)] async fn get_active_payment_attempt( &self, payment: &mut PaymentIntent, @@ -394,6 +397,7 @@ impl PaymentIntentInterface for crate::RouterStore { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn filter_payment_intent_by_constraints( &self, merchant_id: &str, @@ -507,6 +511,7 @@ impl PaymentIntentInterface for crate::RouterStore { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn filter_payment_intents_by_time_range_constraints( &self, merchant_id: &str, @@ -520,6 +525,7 @@ impl PaymentIntentInterface for crate::RouterStore { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn get_filtered_payment_intents_attempt( &self, merchant_id: &str, @@ -660,6 +666,7 @@ impl PaymentIntentInterface for crate::RouterStore { } #[cfg(feature = "olap")] + #[instrument(skip_all)] async fn get_filtered_active_attempt_ids_for_total_count( &self, merchant_id: &str,