mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
refactor(router): added status_code to golden_log_line (#3681)
This commit is contained in:
@ -153,6 +153,7 @@ where
|
|||||||
merchant_id = Empty,
|
merchant_id = Empty,
|
||||||
connector_name = Empty,
|
connector_name = Empty,
|
||||||
payment_method = Empty,
|
payment_method = Empty,
|
||||||
|
status_code = Empty,
|
||||||
flow = "UNKNOWN",
|
flow = "UNKNOWN",
|
||||||
golden_log_line = Empty
|
golden_log_line = Empty
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1095,7 +1095,7 @@ where
|
|||||||
|
|
||||||
#[instrument(
|
#[instrument(
|
||||||
skip(request, state, func, api_auth, payload),
|
skip(request, state, func, api_auth, payload),
|
||||||
fields(request_method, request_url_path)
|
fields(request_method, request_url_path, status_code)
|
||||||
)]
|
)]
|
||||||
pub async fn server_wrap<'a, A, T, U, Q, F, Fut, E>(
|
pub async fn server_wrap<'a, A, T, U, Q, F, Fut, E>(
|
||||||
flow: impl router_env::types::FlowMetric,
|
flow: impl router_env::types::FlowMetric,
|
||||||
@ -1234,6 +1234,8 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
let response_code = res.status().as_u16();
|
let response_code = res.status().as_u16();
|
||||||
|
tracing::Span::current().record("status_code", response_code);
|
||||||
|
|
||||||
let end_instant = Instant::now();
|
let end_instant = Instant::now();
|
||||||
let request_duration = end_instant.saturating_duration_since(start_instant);
|
let request_duration = end_instant.saturating_duration_since(start_instant);
|
||||||
logger::info!(
|
logger::info!(
|
||||||
|
|||||||
@ -92,12 +92,13 @@ impl Visit for Storage<'_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const PERSISTENT_KEYS: [&str; 5] = [
|
const PERSISTENT_KEYS: [&str; 6] = [
|
||||||
"payment_id",
|
"payment_id",
|
||||||
"connector_name",
|
"connector_name",
|
||||||
"merchant_id",
|
"merchant_id",
|
||||||
"flow",
|
"flow",
|
||||||
"payment_method",
|
"payment_method",
|
||||||
|
"status_code",
|
||||||
];
|
];
|
||||||
|
|
||||||
impl<S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>> Layer<S>
|
impl<S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>> Layer<S>
|
||||||
|
|||||||
Reference in New Issue
Block a user