Skip to content

Commit 7c4600c

Browse files
committed
remove log body stamping
1 parent 2d41bc7 commit 7c4600c

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

util/opentelemetry-util-genai/src/opentelemetry/util/genai/_fsspec_upload/fsspec_hook.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,11 @@ def to_dict(
199199
if span:
200200
span.set_attributes(references)
201201
if log_record:
202-
# set in both attributes and body until they are consolidated
203-
# https://github.com/open-telemetry/semantic-conventions/issues/1870
204202
log_record.attributes = {
205203
**(log_record.attributes or {}),
206204
**references,
207205
}
208206

209-
if log_record.body is None or isinstance(log_record.body, Mapping):
210-
log_record.body = {
211-
**(log_record.body or {}),
212-
**references,
213-
}
214-
215207
def shutdown(self) -> None:
216208
# TODO: support timeout
217209
self._executor.shutdown()

util/opentelemetry-util-genai/tests/test_fsspec_upload.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ def test_upload_completions(self):
229229
for attributes in [
230230
span.attributes,
231231
log_record.attributes,
232-
log_record.body,
233232
]:
234233
for ref_key in [
235234
"gen_ai.input.messages_ref",
@@ -273,21 +272,3 @@ def test_stamps_empty_log(self):
273272
self.assertIn("gen_ai.input.messages_ref", log_record.attributes)
274273
self.assertIn("gen_ai.output.messages_ref", log_record.attributes)
275274
self.assertIn("gen_ai.system_instructions_ref", log_record.attributes)
276-
self.assertIn("gen_ai.input.messages_ref", log_record.body)
277-
self.assertIn("gen_ai.output.messages_ref", log_record.body)
278-
self.assertIn("gen_ai.system_instructions_ref", log_record.body)
279-
280-
def test_stamps_log_with_map_body(self):
281-
log_record = LogRecord(body={"hello": "world"})
282-
self.upload_with_log(log_record)
283-
284-
# stamp on both body and attributes, preserving existing
285-
self.assertEqual(log_record.body["hello"], "world")
286-
self.assertIn("gen_ai.input.messages_ref", log_record.body)
287-
self.assertIn("gen_ai.output.messages_ref", log_record.body)
288-
self.assertIn("gen_ai.system_instructions_ref", log_record.body)
289-
290-
def test_doesnt_stamp_log_string_body(self):
291-
log_record = LogRecord(body="hello world")
292-
self.upload_with_log(log_record)
293-
self.assertEqual(log_record.body, "hello world")

0 commit comments

Comments
 (0)