diff --git a/arch/envoy.template.yaml b/arch/envoy.template.yaml index af4e356e..40ddd9a8 100644 --- a/arch/envoy.template.yaml +++ b/arch/envoy.template.yaml @@ -7,7 +7,7 @@ static_resources: address: socket_address: address: 0.0.0.0 - port_value: 9000 + port_value: 10000 traffic_direction: INBOUND filter_chains: - filters: @@ -40,10 +40,6 @@ static_resources: path: "/var/log/access_ingress.log" route_config: name: local_routes - request_headers_to_add: - - header: - key: "x-envoy-force-trace" - value: "true" virtual_hosts: - name: local_service domains: @@ -64,7 +60,7 @@ static_resources: address: socket_address: address: 0.0.0.0 - port_value: 10000 + port_value: 10001 traffic_direction: INBOUND filter_chains: - filters: @@ -97,10 +93,6 @@ static_resources: path: "/var/log/access_ingress_prompt.log" route_config: name: local_routes - request_headers_to_add: - - header: - key: "x-envoy-force-trace" - value: "true" virtual_hosts: - name: local_service domains: @@ -192,10 +184,6 @@ static_resources: path: "/var/log/access_internal.log" route_config: name: local_routes - request_headers_to_add: - - header: - key: "x-envoy-force-trace" - value: "true" virtual_hosts: - name: local_service domains: @@ -268,10 +256,6 @@ static_resources: path: "/var/log/access_llm.log" route_config: name: local_routes - request_headers_to_add: - - header: - key: "x-envoy-force-trace" - value: "true" virtual_hosts: - name: local_service domains: @@ -470,7 +454,7 @@ static_resources: address: socket_address: address: 0.0.0.0 - port_value: 10000 + port_value: 10001 hostname: arch_prompt_gateway_listener - name: arch_llm_listener diff --git a/crates/prompt_gateway/src/http_context.rs b/crates/prompt_gateway/src/http_context.rs index ed5a23c8..bd412bc5 100644 --- a/crates/prompt_gateway/src/http_context.rs +++ b/crates/prompt_gateway/src/http_context.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, fmt::Write, time::Duration}; +use std::{collections::HashMap, time::Duration}; use common::{ common_types::{ @@ -16,12 +16,10 @@ use common::{ http::{CallArgs, Client}, }; use http::StatusCode; -use log::{debug, info, trace, warn}; +use log::{debug, trace, warn}; use proxy_wasm::{traits::HttpContext, types::Action}; use serde_json::Value; -use rand::{distributions::Alphanumeric, thread_rng, Rng}; - use crate::stream_context::{ResponseHandlerType, StreamCallContext, StreamContext}; // HttpContext is the trait that allows the Rust code to interact with HTTP objects. @@ -56,8 +54,8 @@ impl HttpContext for StreamContext { self.request_id = self.get_http_request_header(REQUEST_ID_HEADER); self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER); if self.traceparent.is_none() { - // let trace_id: String = generate_random_hex_string(16); - // self.set_http_request_header("x-client-trace-id", Some(trace_id.as_str())); + // let trace_id: String = generate_random_hex_string(16); + // self.set_http_request_header("x-client-trace-id", Some(trace_id.as_str())); } // let trace_id: String = generate_random_hex_string(16); @@ -389,15 +387,3 @@ impl HttpContext for StreamContext { Action::Continue } } - -fn generate_random_hex_string(len: usize) -> String { - let mut rng = thread_rng(); - let mut hex_string = String::with_capacity(len); - - for _ in 0..len { - let byte = rng.gen::(); - write!(&mut hex_string, "{:02x}", byte).unwrap(); - } - - hex_string -}