mirror of
https://github.com/katanemo/plano.git
synced 2026-07-20 16:41:04 +02:00
remove dead code
This commit is contained in:
parent
4a635cc6e4
commit
c4a3ff2284
2 changed files with 7 additions and 37 deletions
|
|
@ -7,7 +7,7 @@ static_resources:
|
||||||
address:
|
address:
|
||||||
socket_address:
|
socket_address:
|
||||||
address: 0.0.0.0
|
address: 0.0.0.0
|
||||||
port_value: 9000
|
port_value: 10000
|
||||||
traffic_direction: INBOUND
|
traffic_direction: INBOUND
|
||||||
filter_chains:
|
filter_chains:
|
||||||
- filters:
|
- filters:
|
||||||
|
|
@ -40,10 +40,6 @@ static_resources:
|
||||||
path: "/var/log/access_ingress.log"
|
path: "/var/log/access_ingress.log"
|
||||||
route_config:
|
route_config:
|
||||||
name: local_routes
|
name: local_routes
|
||||||
request_headers_to_add:
|
|
||||||
- header:
|
|
||||||
key: "x-envoy-force-trace"
|
|
||||||
value: "true"
|
|
||||||
virtual_hosts:
|
virtual_hosts:
|
||||||
- name: local_service
|
- name: local_service
|
||||||
domains:
|
domains:
|
||||||
|
|
@ -64,7 +60,7 @@ static_resources:
|
||||||
address:
|
address:
|
||||||
socket_address:
|
socket_address:
|
||||||
address: 0.0.0.0
|
address: 0.0.0.0
|
||||||
port_value: 10000
|
port_value: 10001
|
||||||
traffic_direction: INBOUND
|
traffic_direction: INBOUND
|
||||||
filter_chains:
|
filter_chains:
|
||||||
- filters:
|
- filters:
|
||||||
|
|
@ -97,10 +93,6 @@ static_resources:
|
||||||
path: "/var/log/access_ingress_prompt.log"
|
path: "/var/log/access_ingress_prompt.log"
|
||||||
route_config:
|
route_config:
|
||||||
name: local_routes
|
name: local_routes
|
||||||
request_headers_to_add:
|
|
||||||
- header:
|
|
||||||
key: "x-envoy-force-trace"
|
|
||||||
value: "true"
|
|
||||||
virtual_hosts:
|
virtual_hosts:
|
||||||
- name: local_service
|
- name: local_service
|
||||||
domains:
|
domains:
|
||||||
|
|
@ -192,10 +184,6 @@ static_resources:
|
||||||
path: "/var/log/access_internal.log"
|
path: "/var/log/access_internal.log"
|
||||||
route_config:
|
route_config:
|
||||||
name: local_routes
|
name: local_routes
|
||||||
request_headers_to_add:
|
|
||||||
- header:
|
|
||||||
key: "x-envoy-force-trace"
|
|
||||||
value: "true"
|
|
||||||
virtual_hosts:
|
virtual_hosts:
|
||||||
- name: local_service
|
- name: local_service
|
||||||
domains:
|
domains:
|
||||||
|
|
@ -268,10 +256,6 @@ static_resources:
|
||||||
path: "/var/log/access_llm.log"
|
path: "/var/log/access_llm.log"
|
||||||
route_config:
|
route_config:
|
||||||
name: local_routes
|
name: local_routes
|
||||||
request_headers_to_add:
|
|
||||||
- header:
|
|
||||||
key: "x-envoy-force-trace"
|
|
||||||
value: "true"
|
|
||||||
virtual_hosts:
|
virtual_hosts:
|
||||||
- name: local_service
|
- name: local_service
|
||||||
domains:
|
domains:
|
||||||
|
|
@ -470,7 +454,7 @@ static_resources:
|
||||||
address:
|
address:
|
||||||
socket_address:
|
socket_address:
|
||||||
address: 0.0.0.0
|
address: 0.0.0.0
|
||||||
port_value: 10000
|
port_value: 10001
|
||||||
hostname: arch_prompt_gateway_listener
|
hostname: arch_prompt_gateway_listener
|
||||||
|
|
||||||
- name: arch_llm_listener
|
- name: arch_llm_listener
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use std::{collections::HashMap, fmt::Write, time::Duration};
|
use std::{collections::HashMap, time::Duration};
|
||||||
|
|
||||||
use common::{
|
use common::{
|
||||||
common_types::{
|
common_types::{
|
||||||
|
|
@ -16,12 +16,10 @@ use common::{
|
||||||
http::{CallArgs, Client},
|
http::{CallArgs, Client},
|
||||||
};
|
};
|
||||||
use http::StatusCode;
|
use http::StatusCode;
|
||||||
use log::{debug, info, trace, warn};
|
use log::{debug, trace, warn};
|
||||||
use proxy_wasm::{traits::HttpContext, types::Action};
|
use proxy_wasm::{traits::HttpContext, types::Action};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
|
||||||
|
|
||||||
use crate::stream_context::{ResponseHandlerType, StreamCallContext, StreamContext};
|
use crate::stream_context::{ResponseHandlerType, StreamCallContext, StreamContext};
|
||||||
|
|
||||||
// HttpContext is the trait that allows the Rust code to interact with HTTP objects.
|
// 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.request_id = self.get_http_request_header(REQUEST_ID_HEADER);
|
||||||
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
||||||
if self.traceparent.is_none() {
|
if self.traceparent.is_none() {
|
||||||
// let trace_id: String = generate_random_hex_string(16);
|
// let trace_id: String = generate_random_hex_string(16);
|
||||||
// self.set_http_request_header("x-client-trace-id", Some(trace_id.as_str()));
|
// self.set_http_request_header("x-client-trace-id", Some(trace_id.as_str()));
|
||||||
}
|
}
|
||||||
// let trace_id: String = generate_random_hex_string(16);
|
// let trace_id: String = generate_random_hex_string(16);
|
||||||
|
|
||||||
|
|
@ -389,15 +387,3 @@ impl HttpContext for StreamContext {
|
||||||
Action::Continue
|
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::<u8>();
|
|
||||||
write!(&mut hex_string, "{:02x}", byte).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
hex_string
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue