refactor: set merchant_id as MERCHANT_ID_NOT_FOUND for traces and metrics if not found (#2156)

This commit is contained in:
Anish Rajan
2023-09-17 21:26:13 +05:30
committed by GitHub
parent 7d988fa3e3
commit d40fae87fe

View File

@ -726,7 +726,10 @@ where
.authenticate_and_fetch(request.headers(), state)
.await
.switch()?;
let merchant_id = auth_out.get_merchant_id().unwrap_or("").to_string();
let merchant_id = auth_out
.get_merchant_id()
.unwrap_or("MERCHANT_ID_NOT_FOUND")
.to_string();
tracing::Span::current().record("merchant_id", &merchant_id);
let output = func(state, auth_out, payload).await.switch();