mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	feat(multitenancy): add tenant_id as a field for data pipeline and support individual database for clickhouse (#4867)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Arun Raj M <jarnura47@gmail.com> Co-authored-by: Sampras Lopes <sampras.lopes@juspay.in>
This commit is contained in:
		| @ -1,3 +1,4 @@ | ||||
| use common_utils::consts::TENANT_HEADER; | ||||
| use futures::StreamExt; | ||||
| use router_env::{ | ||||
|     logger, | ||||
| @ -140,10 +141,17 @@ where | ||||
|     // TODO: have a common source of truth for the list of top level fields | ||||
|     // /crates/router_env/src/logger/storage.rs also has a list of fields  called PERSISTENT_KEYS | ||||
|     fn call(&self, req: actix_web::dev::ServiceRequest) -> Self::Future { | ||||
|         let tenant_id = req | ||||
|             .headers() | ||||
|             .get(TENANT_HEADER) | ||||
|             .and_then(|i| i.to_str().ok()) | ||||
|             .map(|s| s.to_owned()); | ||||
|         let response_fut = self.service.call(req); | ||||
|  | ||||
|         Box::pin( | ||||
|             async move { | ||||
|                 if let Some(tenant_id) = tenant_id { | ||||
|                     router_env::tracing::Span::current().record("tenant_id", &tenant_id); | ||||
|                 } | ||||
|                 let response = response_fut.await; | ||||
|                 router_env::tracing::Span::current().record("golden_log_line", true); | ||||
|                 response | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jagan
					Jagan