diff --git a/app-server/src/traces/spans.rs b/app-server/src/traces/spans.rs index 004ffff1..d766d1aa 100644 --- a/app-server/src/traces/spans.rs +++ b/app-server/src/traces/spans.rs @@ -141,7 +141,12 @@ impl SpanAttributes { serde_json::from_value::(span_type.clone()).unwrap_or_default() } else { // quick hack until we figure how to set span type on auto-instrumentation - if self.attributes.contains_key(GEN_AI_SYSTEM) { + if self.attributes.contains_key(GEN_AI_SYSTEM) + || self + .attributes + .iter() + .any(|(k, _)| k.starts_with("gen_ai.") || k.starts_with("llm.")) + { SpanType::LLM } else { SpanType::DEFAULT