diff --git a/crates/llm_gateway/src/stream_context.rs b/crates/llm_gateway/src/stream_context.rs index e7a17e9e..528358a3 100644 --- a/crates/llm_gateway/src/stream_context.rs +++ b/crates/llm_gateway/src/stream_context.rs @@ -176,8 +176,6 @@ impl HttpContext for StreamContext { // Envoy's HTTP model is event driven. The WASM ABI has given implementors events to hook onto // the lifecycle of the http request and response. fn on_http_request_headers(&mut self, _num_headers: usize, _end_of_stream: bool) -> Action { - let request_path = self.get_http_request_header(":path").unwrap_or_default(); - debug!("request_path: {}", request_path); self.select_llm_provider(); // if endpoint is not set then use provider name as routing header so envoy can resolve the cluster name diff --git a/crates/prompt_gateway/src/http_context.rs b/crates/prompt_gateway/src/http_context.rs index d5f62509..1ff7f91d 100644 --- a/crates/prompt_gateway/src/http_context.rs +++ b/crates/prompt_gateway/src/http_context.rs @@ -10,6 +10,7 @@ use common::{ }, errors::ServerError, http::{CallArgs, Client}, + pii::obfuscate_auth_header, }; use http::StatusCode; use log::{debug, trace, warn}; @@ -39,6 +40,12 @@ impl HttpContext for StreamContext { self.is_chat_completions_request = request_path == CHAT_COMPLETIONS_PATH; + trace!( + "on_http_request_headers S[{}] req_headers={:?}", + self.context_id, + obfuscate_auth_header(&mut self.get_http_request_headers()) + ); + self.request_id = self.get_http_request_header(REQUEST_ID_HEADER); self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER); Action::Continue @@ -137,10 +144,7 @@ impl HttpContext for StreamContext { if metadata.is_none() { metadata = Some(HashMap::new()); } - metadata - .as_mut() - .unwrap() - .insert("optimize_context_window".to_string(), "true".to_string()); + metadata.as_mut().unwrap().insert("optimize_context_window".to_string(), "true".to_string()); } }