refactor(router): added payment_method to golden log line (#3620)

This commit is contained in:
Sahkal Poddar
2024-02-14 15:30:02 +05:30
committed by GitHub
parent 7b1c65b60d
commit c5343dfcc2
3 changed files with 10 additions and 2 deletions

View File

@ -152,6 +152,7 @@ where
payment_id = Empty,
merchant_id = Empty,
connector_name = Empty,
payment_method = Empty,
flow = "UNKNOWN"
)
.or_current(),

View File

@ -265,7 +265,7 @@ pub enum CaptureSyncMethod {
/// Handle the flow by interacting with connector module
/// `connector_request` is applicable only in case if the `CallConnectorAction` is `Trigger`
/// In other cases, It will be created if required, even if it is not passed
#[instrument(skip_all)]
#[instrument(skip_all, fields(payment_method))]
pub async fn execute_connector_processing_step<
'b,
'a,
@ -285,6 +285,7 @@ where
{
// If needed add an error stack as follows
// connector_integration.build_request(req).attach_printable("Failed to build request");
tracing::Span::current().record("payment_method", &req.payment_method.to_string());
logger::debug!(connector_request=?connector_request);
let mut router_data = req.clone();
match call_connector_action {

View File

@ -92,7 +92,13 @@ impl Visit for Storage<'_> {
}
}
const PERSISTENT_KEYS: [&str; 4] = ["payment_id", "connector_name", "merchant_id", "flow"];
const PERSISTENT_KEYS: [&str; 5] = [
"payment_id",
"connector_name",
"merchant_id",
"flow",
"payment_method",
];
impl<S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>> Layer<S>
for StorageSubscription