From d40fae87feb509718059ab2d72539f37f26a8251 Mon Sep 17 00:00:00 2001 From: Anish Rajan Date: Sun, 17 Sep 2023 21:26:13 +0530 Subject: [PATCH] refactor: set merchant_id as `MERCHANT_ID_NOT_FOUND` for traces and metrics if not found (#2156) --- crates/router/src/services/api.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs index 2678c7d079..feee1db5e4 100644 --- a/crates/router/src/services/api.rs +++ b/crates/router/src/services/api.rs @@ -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();