From 9b43957df29919b50aa1074e68b0b0f547b9eeb7 Mon Sep 17 00:00:00 2001 From: mairp Date: Fri, 25 Sep 2026 15:36:23 +0400 Subject: [PATCH] fix(phoenix): leave GenAI spans to Phoenix's own LLM/TOOL inference The generic CHAIN fallback in transform/phoenix_kind also hit spans that carry GenAI semconv (gen_ai.operation.name), e.g. OpenClaw model calls. Phoenix infers LLM/TOOL from those itself, and with CHAIN forced they lost the chat-message view (system prompt, turns, tools). Exclude them from the generic GUARDRAIL/CHAIN rules. Claude-Session: https://claude.ai/code/session_016d5AJ1LjeunQ5sz5XEvxQQ Signed-off-by: mairp --- otel-collector/config.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/otel-collector/config.yaml b/otel-collector/config.yaml index a1ae934..33caa95 100644 --- a/otel-collector/config.yaml +++ b/otel-collector/config.yaml @@ -50,8 +50,10 @@ processors: - set(attributes["openinference.span.kind"], "AGENT") where attributes["openinference.span.kind"] == nil and resource.attributes["service.name"] == "openclaw-gateway" and (name == "openclaw.run" or name == "openclaw.harness.run") - set(attributes["openinference.span.kind"], "TOOL") where attributes["openinference.span.kind"] == nil and resource.attributes["service.name"] == "openclaw-gateway" and name == "openclaw.exec" # Generic, any producer: policy/guard steps by span name, then CHAIN as the default step kind. - - set(attributes["openinference.span.kind"], "GUARDRAIL") where attributes["openinference.span.kind"] == nil and IsMatch(name, "(?i)(gate|guard|perimeter|killswitch|redact|sensitivity)") - - set(attributes["openinference.span.kind"], "CHAIN") where attributes["openinference.span.kind"] == nil + # Spans with GenAI semconv (gen_ai.operation.name: model calls, tool executions) are left + # alone: Phoenix infers LLM/TOOL from them itself and renders the chat-message view. + - set(attributes["openinference.span.kind"], "GUARDRAIL") where attributes["openinference.span.kind"] == nil and attributes["gen_ai.operation.name"] == nil and IsMatch(name, "(?i)(gate|guard|perimeter|killswitch|redact|sensitivity)") + - set(attributes["openinference.span.kind"], "CHAIN") where attributes["openinference.span.kind"] == nil and attributes["gen_ai.operation.name"] == nil # NOTE: the former `attributes/scrub` processor (deleted gen_ai.prompt / gen_ai.completion / # gen_ai.request.messages / gen_ai.response.messages) was REMOVED ON PURPOSE (2026-09-25, # owner decision): full prompts and completions are captured and reach Tempo, Loki and