fix(logging): add flow to persistent logs fields (#3472)

This commit is contained in:
Sampras Lopes
2024-01-30 16:25:11 +05:30
committed by GitHub
parent bec4f2a24e
commit ac491038b1
2 changed files with 4 additions and 3 deletions

View File

@ -58,7 +58,7 @@ where
let request_id = request_id_fut.await?; let request_id = request_id_fut.await?;
let request_id = request_id.as_hyphenated().to_string(); let request_id = request_id.as_hyphenated().to_string();
if let Some(upstream_request_id) = old_x_request_id { if let Some(upstream_request_id) = old_x_request_id {
router_env::logger::info!(?request_id, ?upstream_request_id); router_env::logger::info!(?upstream_request_id);
} }
let mut response = response_fut.await?; let mut response = response_fut.await?;
response.headers_mut().append( response.headers_mut().append(
@ -146,7 +146,8 @@ where
"golden_log_line", "golden_log_line",
payment_id = Empty, payment_id = Empty,
merchant_id = Empty, merchant_id = Empty,
connector_name = Empty connector_name = Empty,
flow = "UNKNOWN"
) )
.or_current(), .or_current(),
), ),

View File

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