refactor(dynamic_routing): add info logs to log the grpc request and response (#6962)

This commit is contained in:
Chethan Rao
2025-01-16 15:57:56 +05:30
committed by GitHub
parent 343465165b
commit 72904842ed
5 changed files with 90 additions and 43 deletions

View File

@ -128,3 +128,13 @@ impl<T> AddHeaders for tonic::Request<T> {
});
}
}
#[cfg(feature = "dynamic_routing")]
pub(crate) fn create_grpc_request<T: Debug>(message: T, headers: GrpcHeaders) -> tonic::Request<T> {
let mut request = tonic::Request::new(message);
request.add_headers_to_grpc_request(headers);
logger::info!(dynamic_routing_request=?request);
request
}