Skip to content

Commit 14deddc

Browse files
committed
Fix broken tests
1 parent e5d6b7d commit 14deddc

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

instrumentation-genai/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def handle_response(
228228
}
229229
)
230230
event = LogRecord(
231-
name="gen_ai.client.inference.operation.details",
231+
event_name="gen_ai.client.inference.operation.details",
232232
)
233233
event.attributes = attributes
234234
if capture_content in (

instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/test_chat_completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ def test_generate_content_invalid_role(
267267
log = logs[0].log_record
268268
assert log.attributes == {
269269
"gen_ai.system": "vertex_ai",
270-
"event.name": "gen_ai.user.message",
271270
}
271+
assert log.event_name == "gen_ai.user.message"
272272
assert log.body == {
273273
"content": [{"text": "Say this is a test"}],
274274
"role": "invalid_role",

instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/test_function_calling.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,21 @@ def test_tool_events_no_content(
265265

266266
assert tool_log1.attributes == {
267267
"gen_ai.system": "vertex_ai",
268-
"event.name": "gen_ai.tool.message",
269268
}
269+
assert tool_log1.event_name == "gen_ai.tool.message"
270270
assert tool_log1.body == {
271271
"role": "user",
272272
"id": "get_current_weather_0",
273273
}
274274
assert tool_log1.event_name == "gen_ai.tool.message"
275275

276-
assert tool_log2.attributes == {
277-
"gen_ai.system": "vertex_ai",
278-
"event.name": "gen_ai.tool.message",
279-
}
276+
assert tool_log2.attributes == {"gen_ai.system": "vertex_ai"}
277+
280278
assert tool_log2.body == {
281279
"role": "user",
282280
"id": "get_current_weather_1",
283281
}
282+
assert tool_log2.event_name == "gen_ai.tool.message"
284283

285284
assert choice_log.attributes == {"gen_ai.system": "vertex_ai"}
286285
assert choice_log.event_name == "gen_ai.choice"

0 commit comments

Comments
 (0)