Skip to content

Commit df63d17

Browse files
committed
Removing embedding events emission
1 parent a00ea05 commit df63d17

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
_apply_llm_finish_attributes,
8686
_get_embedding_span_name,
8787
_get_llm_span_name,
88-
_maybe_emit_embedding_event,
8988
_maybe_emit_llm_event,
9089
)
9190
from opentelemetry.util.genai.types import (
@@ -181,7 +180,6 @@ def _stop(self, invocation: _T) -> _T:
181180
elif isinstance(invocation, EmbeddingInvocation):
182181
_apply_embedding_finish_attributes(span, invocation)
183182
self._record_metrics(invocation, span)
184-
_maybe_emit_embedding_event(self._logger, span, invocation)
185183
finally:
186184
# Detach context and end span even if finishing fails
187185
otel_context.detach(invocation.context_token)
@@ -208,9 +206,6 @@ def _fail(self, invocation: _T, error: Error) -> _T:
208206
_apply_embedding_finish_attributes(span, invocation)
209207
_apply_error_attributes(span, error, error_type)
210208
self._record_metrics(invocation, span, error_type=error_type)
211-
_maybe_emit_embedding_event(
212-
self._logger, span, invocation, error_type
213-
)
214209
finally:
215210
# Detach context and end span even if finishing fails
216211
otel_context.detach(invocation.context_token)

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

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -227,44 +227,6 @@ def _maybe_emit_llm_event(
227227
logger.emit(event)
228228

229229

230-
def _maybe_emit_embedding_event(
231-
logger: Logger | None,
232-
span: Span,
233-
invocation: EmbeddingInvocation,
234-
error_type: str | None = None,
235-
) -> None:
236-
"""Emit a gen_ai.client.inference.operation.details event to the logger.
237-
238-
This function creates a LogRecord event following the semantic convention
239-
for gen_ai.client.inference.operation.details as specified in the GenAI
240-
event semantic conventions.
241-
242-
For more details, see the semantic convention documentation:
243-
https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-events.md#event-eventgen_aiclientinferenceoperationdetails
244-
"""
245-
if not is_experimental_mode() or not should_emit_event() or logger is None:
246-
return
247-
248-
# Build event attributes by reusing the attribute getter functions
249-
attributes: dict[str, Any] = {}
250-
attributes.update(_get_embedding_common_attributes(invocation))
251-
attributes.update(_get_embedding_request_attributes(invocation))
252-
attributes.update(_get_embedding_response_attributes(invocation))
253-
254-
# Add error.type if operation ended in error
255-
if error_type is not None:
256-
attributes[error_attributes.ERROR_TYPE] = error_type
257-
258-
# Create and emit the event
259-
context = set_span_in_context(span, get_current())
260-
event = LogRecord(
261-
event_name="gen_ai.client.embedding.operation.details",
262-
attributes=attributes,
263-
context=context,
264-
)
265-
logger.emit(event)
266-
267-
268230
def _apply_llm_finish_attributes(
269231
span: Span, invocation: LLMInvocation
270232
) -> None:
@@ -403,7 +365,6 @@ def _get_embedding_response_attributes(
403365
"_get_llm_response_attributes",
404366
"_get_llm_span_name",
405367
"_maybe_emit_llm_event",
406-
"_maybe_emit_embedding_event",
407368
"_apply_embedding_finish_attributes",
408369
"_get_embedding_common_attributes",
409370
"_get_embedding_request_attributes",

0 commit comments

Comments
 (0)