Skip to content

Commit 7cef667

Browse files
authored
chore: modify the attribute field (#91)
* chore: modify the attribute field * chore: gen_ai.system field
1 parent 800f80c commit 7cef667

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

veadk/tracing/base_tracer.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ async def on_user_message_callback(
6666
)
6767
current_session = invocation_context.session
6868

69-
span.set_attribute("app_name", current_session.app_name)
70-
span.set_attribute("user_id", current_session.user_id)
71-
span.set_attribute("session_id", current_session.id)
69+
span.set_attribute("app.name", current_session.app_name)
70+
span.set_attribute("user.id", current_session.user_id)
71+
span.set_attribute("session.id", current_session.id)
7272

73-
span.set_attribute("agent_name", agent_name)
74-
span.set_attribute("invoke_branch", invoke_branch)
73+
span.set_attribute("agent.name", agent_name)
74+
span.set_attribute("invoke.branch", invoke_branch)
75+
span.set_attribute("gen_ai.system", "veadk")
7576

7677
logger.debug(
7778
f"Add attributes to {span_name}: app_name={current_session.app_name}, user_id={current_session.user_id}, session_id={current_session.id}, agent_name={agent_name}, invoke_branch={invoke_branch}"
@@ -180,7 +181,7 @@ def tracer_hook_after_model(
180181
agent_name = callback_context.agent_name
181182
attributes["agent.name"] = agent_name
182183
attributes["app.name"] = app_name
183-
184+
attributes["gen_ai.system"] = "veadk"
184185
# prompt
185186
user_content = callback_context.user_content
186187
role = None
@@ -271,6 +272,7 @@ def tracer_hook_after_tool(
271272
"agent.name": agent_name,
272273
"app.name": app_name,
273274
"tool.name": tool_name,
275+
"gen_ai.system": "veadk",
274276
}
275277

276278
# Set all attributes at once if possible, else fallback to individual

0 commit comments

Comments
 (0)