From 4b7065817d4054250b15cf73e43c5ed00e3cad65 Mon Sep 17 00:00:00 2001 From: Musa Date: Fri, 6 Feb 2026 09:33:13 -0800 Subject: [PATCH] refactor: rename custom_attribute_prefixes to span_attribute_header_prefixes in configuration and related handlers --- config/arch_config_schema.yaml | 2 +- crates/brightstaff/src/handlers/agent_chat_completions.rs | 2 +- crates/brightstaff/src/handlers/llm.rs | 2 +- crates/brightstaff/src/tracing/custom_attributes.rs | 8 ++++---- crates/common/src/configuration.rs | 2 +- demos/use_cases/travel_agents/config.yaml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/arch_config_schema.yaml b/config/arch_config_schema.yaml index 52820f24..5f93c5ca 100644 --- a/config/arch_config_schema.yaml +++ b/config/arch_config_schema.yaml @@ -382,7 +382,7 @@ properties: type: integer trace_arch_internal: type: boolean - custom_attribute_prefixes: + span_attribute_header_prefixes: type: array items: type: string diff --git a/crates/brightstaff/src/handlers/agent_chat_completions.rs b/crates/brightstaff/src/handlers/agent_chat_completions.rs index 886c514b..e8ee5e13 100644 --- a/crates/brightstaff/src/handlers/agent_chat_completions.rs +++ b/crates/brightstaff/src/handlers/agent_chat_completions.rs @@ -187,7 +187,7 @@ async fn handle_agent_chat( tracing_config .as_ref() .as_ref() - .and_then(|tracing| tracing.custom_attribute_prefixes.as_deref()), + .and_then(|tracing| tracing.span_attribute_header_prefixes.as_deref()), ); let chat_request_bytes = request.collect().await?.to_bytes(); diff --git a/crates/brightstaff/src/handlers/llm.rs b/crates/brightstaff/src/handlers/llm.rs index 953b9fdd..7c6d449b 100644 --- a/crates/brightstaff/src/handlers/llm.rs +++ b/crates/brightstaff/src/handlers/llm.rs @@ -53,7 +53,7 @@ pub async fn llm_chat( tracing_config .as_ref() .as_ref() - .and_then(|tracing| tracing.custom_attribute_prefixes.as_deref()), + .and_then(|tracing| tracing.span_attribute_header_prefixes.as_deref()), ); let request_id: String = match request_headers .get(REQUEST_ID_HEADER) diff --git a/crates/brightstaff/src/tracing/custom_attributes.rs b/crates/brightstaff/src/tracing/custom_attributes.rs index 563e5ece..7047a5bb 100644 --- a/crates/brightstaff/src/tracing/custom_attributes.rs +++ b/crates/brightstaff/src/tracing/custom_attributes.rs @@ -4,20 +4,20 @@ use hyper::header::HeaderMap; pub fn extract_custom_trace_attributes( headers: &HeaderMap, - custom_attribute_prefixes: Option<&[String]>, + span_attribute_header_prefixes: Option<&[String]>, ) -> HashMap { let mut attributes = HashMap::new(); - let Some(custom_attribute_prefixes) = custom_attribute_prefixes else { + let Some(span_attribute_header_prefixes) = span_attribute_header_prefixes else { return attributes; }; - if custom_attribute_prefixes.is_empty() { + if span_attribute_header_prefixes.is_empty() { return attributes; } for (name, value) in headers.iter() { let header_name = name.as_str(); let mut matched_prefix: Option<&str> = None; - for prefix in custom_attribute_prefixes { + for prefix in span_attribute_header_prefixes { if header_name.starts_with(prefix) { matched_prefix = Some(prefix.as_str()); break; diff --git a/crates/common/src/configuration.rs b/crates/common/src/configuration.rs index 5f512eed..031c24c0 100644 --- a/crates/common/src/configuration.rs +++ b/crates/common/src/configuration.rs @@ -90,7 +90,7 @@ pub struct Overrides { pub struct Tracing { pub sampling_rate: Option, pub trace_arch_internal: Option, - pub custom_attribute_prefixes: Option>, + pub span_attribute_header_prefixes: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] diff --git a/demos/use_cases/travel_agents/config.yaml b/demos/use_cases/travel_agents/config.yaml index 2924cde8..cb2a632c 100644 --- a/demos/use_cases/travel_agents/config.yaml +++ b/demos/use_cases/travel_agents/config.yaml @@ -55,5 +55,5 @@ listeners: tracing: random_sampling: 100 - custom_attribute_prefixes: + span_attribute_header_prefixes: - x-katanemo-