Skip to content

Commit 7071d0f

Browse files
committed
Revert "Additional span attributes"
This reverts commit 3a37f43.
1 parent 0776a7f commit 7071d0f

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

util/opentelemetry-util-genai/README.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ This package provides these span attributes.
2121
-> gen_ai.usage.input_tokens: Int(24)
2222
-> gen_ai.usage.output_tokens: Int(7)
2323
-> gen_ai.input.messages: Str("[{\"role\": \"user\", \"content\": \"hello world\"}]")
24-
-> gen_ai.request.top_p: Double(0.9)
25-
-> gen_ai.request.frequency_penalty: Double(0.5)
26-
-> gen_ai.request.presence_penalty: Double(0.5)
27-
-> gen_ai.request.stop_sequences: Slice(["\n","Human:","AI:"])
28-
-> gen_ai.request.seed: Int(100)
29-
-> gen_ai.request.max_tokens: Int(100)
30-
-> gen_ai.request.temperature: Double(0.1)
3124

3225

3326
Installation

util/opentelemetry-util-genai/src/opentelemetry/util/genai/generators.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -158,52 +158,6 @@ def _maybe_set_span_output_messages(
158158
)
159159

160160

161-
def _maybe_set_additional_span_attributes(
162-
span: Span, invocation: LLMInvocation
163-
) -> None:
164-
if "top_p" in invocation.attributes:
165-
span.set_attribute(
166-
GenAI.GEN_AI_REQUEST_TOP_P,
167-
invocation.attributes["top_p"],
168-
)
169-
170-
if "frequency_penalty" in invocation.attributes:
171-
span.set_attribute(
172-
GenAI.GEN_AI_REQUEST_FREQUENCY_PENALTY,
173-
invocation.attributes["frequency_penalty"],
174-
)
175-
176-
if "presence_penalty" in invocation.attributes:
177-
span.set_attribute(
178-
GenAI.GEN_AI_REQUEST_PRESENCE_PENALTY,
179-
invocation.attributes["presence_penalty"],
180-
)
181-
182-
if "stop" in invocation.attributes:
183-
span.set_attribute(
184-
GenAI.GEN_AI_REQUEST_STOP_SEQUENCES,
185-
invocation.attributes["stop"],
186-
)
187-
188-
if "seed" in invocation.attributes:
189-
span.set_attribute(
190-
GenAI.GEN_AI_REQUEST_SEED,
191-
invocation.attributes["seed"],
192-
)
193-
194-
if "temperature" in invocation.attributes:
195-
span.set_attribute(
196-
GenAI.GEN_AI_REQUEST_TEMPERATURE,
197-
invocation.attributes["temperature"],
198-
)
199-
200-
if "max_completion_tokens" in invocation.attributes:
201-
span.set_attribute(
202-
GenAI.GEN_AI_REQUEST_MAX_TOKENS,
203-
invocation.attributes["max_completion_tokens"],
204-
)
205-
206-
207161
class BaseTelemetryGenerator:
208162
"""
209163
Abstract base for emitters mapping GenAI types -> OpenTelemetry.
@@ -316,7 +270,6 @@ def _apply_common_span_attributes(
316270
prompt_tokens,
317271
completion_tokens,
318272
)
319-
_maybe_set_additional_span_attributes(span, invocation)
320273
genai_attributes = _get_genai_attributes(
321274
request_model,
322275
response_model,

0 commit comments

Comments
 (0)