Skip to content

Instantly share code, notes, and snippets.

@nagkumar91
Created February 27, 2026 18:36
Show Gist options
  • Select an option

  • Save nagkumar91/a01becb2dafe73b602bc2e176c9b3713 to your computer and use it in GitHub Desktop.

Select an option

Save nagkumar91/a01becb2dafe73b602bc2e176c9b3713 to your computer and use it in GitHub Desktop.
Issue #290 Fix: Detailed Trace Spans & Parent-Child Relationships

Issue #290 Fix: Unified Async Agent Trace

Architecture

  Planner (recruitment-planner)
  │
  ├── asyncio.create_task() → worker-rose      (candidate processing + tools)
  ├── asyncio.create_task() → worker-aurora     (candidate processing + tools)
  ├── asyncio.create_task() → eitl-review       (interview scheduling + tools)
  └── asyncio.create_task() → summary-llm       (LLM-only summary)

Before Fix (Fragmented)

Each asyncio.create_task() worker would get a separate trace_id, producing 5-10 disconnected traces per job — impossible to correlate in App Insights.

After Fix (Unified)

Single trace_id: 607584201bf61e4a4a3f80584b997551
Total spans: 19
Root span: invoke_agent recruitment-planner

Span Summary

# Span Name Operation Kind Duration Parent
1 invoke_agent recruitment-planner invoke_agent CLIENT 3624ms
2 invoke_agent worker-rose invoke_agent CLIENT 3546ms invoke_agent recruitment-planner
3 invoke_agent eitl-review invoke_agent CLIENT 1974ms invoke_agent recruitment-planner
4 invoke_agent worker-aurora invoke_agent CLIENT 3617ms invoke_agent recruitment-planner
5 invoke_agent summary-llm invoke_agent CLIENT 1083ms invoke_agent recruitment-planner
6 chat gpt-4o-2024-08-06 chat CLIENT 1171ms invoke_agent worker-rose
7 chat gpt-4o-2024-08-06 chat CLIENT 1110ms invoke_agent eitl-review
8 chat gpt-4o-2024-08-06 chat CLIENT 1079ms invoke_agent summary-llm
9 chat gpt-4o-2024-08-06 chat CLIENT 1178ms invoke_agent worker-aurora
10 execute_tool schedule_interview execute_tool INTERNAL 306ms invoke_agent eitl-review
11 execute_tool get_candidate_info execute_tool INTERNAL 505ms invoke_agent worker-rose
12 execute_tool get_candidate_info execute_tool INTERNAL 504ms invoke_agent worker-aurora
13 chat gpt-4o-2024-08-06 chat CLIENT 551ms invoke_agent eitl-review
14 chat gpt-4o-2024-08-06 chat CLIENT 833ms invoke_agent worker-rose
15 chat gpt-4o-2024-08-06 chat CLIENT 964ms invoke_agent worker-aurora
16 execute_tool send_email execute_tool INTERNAL 205ms invoke_agent worker-rose
17 execute_tool send_email execute_tool INTERNAL 205ms invoke_agent worker-aurora
18 chat gpt-4o-2024-08-06 chat CLIENT 822ms invoke_agent worker-rose
19 chat gpt-4o-2024-08-06 chat CLIENT 756ms invoke_agent worker-aurora

Trace Tree (Parent → Child)

● invoke_agent recruitment-planner  [edefa74b]  3624ms  (OK)
  └── invoke_agent worker-rose  [348447bd]  3546ms  (OK)
    └── chat gpt-4o-2024-08-06  [bfdadbb1]  1171ms  (OK)
    └── execute_tool get_candidate_info  [703c1e36]  505ms  (OK)
    └── chat gpt-4o-2024-08-06  [f2cefe31]  833ms  (OK)
    └── execute_tool send_email  [32bee92a]  205ms  (OK)
    └── chat gpt-4o-2024-08-06  [abf77497]  822ms  (OK)
  └── invoke_agent eitl-review  [92720285]  1974ms  (OK)
    └── chat gpt-4o-2024-08-06  [fef7d2cc]  1110ms  (OK)
    └── execute_tool schedule_interview  [bbe64937]  306ms  (OK)
    └── chat gpt-4o-2024-08-06  [54619daf]  551ms  (OK)
  └── invoke_agent worker-aurora  [76a70af5]  3617ms  (OK)
    └── chat gpt-4o-2024-08-06  [faf52052]  1178ms  (OK)
    └── execute_tool get_candidate_info  [60d4e87f]  504ms  (OK)
    └── chat gpt-4o-2024-08-06  [51ac4b91]  964ms  (OK)
    └── execute_tool send_email  [442761d8]  205ms  (OK)
    └── chat gpt-4o-2024-08-06  [5c5abb17]  756ms  (OK)
  └── invoke_agent summary-llm  [a812af7a]  1083ms  (OK)
    └── chat gpt-4o-2024-08-06  [60841d17]  1079ms  (OK)

Detailed Span Attributes

invoke_agent recruitment-planner

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id edefa74b8fb64f7c
parent_span_id None (root)
kind CLIENT
status OK
duration 3624ms

Attributes:

Attribute Value
gen_ai.agent.name recruitment-planner
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process 2 candidates + review"}]}]
gen_ai.operation.name invoke_agent
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "Done."}]}]
gen_ai.usage.input_tokens 1059
gen_ai.usage.output_tokens 268
gen_ai.usage.total_tokens 1327

invoke_agent worker-rose

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 348447bdee54254c
parent_span_id invoke_agent recruitment-planner (edefa74b8fb6…)
kind CLIENT
status OK
duration 3546ms

Attributes:

Attribute Value
gen_ai.agent.name worker-rose
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name invoke_agent
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "Candidate Rose's information has been …
gen_ai.provider.name azure.ai.openai
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 415
gen_ai.usage.output_tokens 97
gen_ai.usage.total_tokens 512

invoke_agent eitl-review

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 9272028567c1cee4
parent_span_id invoke_agent recruitment-planner (edefa74b8fb6…)
kind CLIENT
status OK
duration 1974ms

Attributes:

Attribute Value
gen_ai.agent.name eitl-review
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Schedule the interview."}]}, {"role": "user…
gen_ai.operation.name invoke_agent
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "The interview for candidate Rose has b…
gen_ai.provider.name azure.ai.openai
gen_ai.tool.definitions [{"type": "function", "function": {"name": "schedule_interview", "description": "Schedule interview.…
gen_ai.usage.input_tokens 181
gen_ai.usage.output_tokens 44
gen_ai.usage.total_tokens 225

invoke_agent worker-aurora

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 76a70af5ef339d25
parent_span_id invoke_agent recruitment-planner (edefa74b8fb6…)
kind CLIENT
status OK
duration 3617ms

Attributes:

Attribute Value
gen_ai.agent.name worker-aurora
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name invoke_agent
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "I have processed candidate Aurora. Her…
gen_ai.provider.name azure.ai.openai
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 437
gen_ai.usage.output_tokens 118
gen_ai.usage.total_tokens 555

invoke_agent summary-llm

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id a812af7a2be8b37f
parent_span_id invoke_agent recruitment-planner (edefa74b8fb6…)
kind CLIENT
status OK
duration 1083ms

Attributes:

Attribute Value
gen_ai.agent.name summary-llm
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Summarize the results in 1 sentence."}]}, {…
gen_ai.operation.name invoke_agent
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "All candidates were processed without …
gen_ai.provider.name azure.ai.openai
gen_ai.usage.input_tokens 26
gen_ai.usage.output_tokens 9
gen_ai.usage.total_tokens 35

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id bfdadbb15c94bb40
parent_span_id invoke_agent worker-rose (348447bdee54…)
kind CLIENT
status OK
duration 1171ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "tool_call", "id": "call_tDKh3v7H7NzDVh41OWScLTf1", "name"…
gen_ai.output.type json
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["tool_calls"]
gen_ai.response.id chatcmpl-DDwyTm0l7CeKfe0xWsFIKgdf9DbSB
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 90
gen_ai.usage.output_tokens 16
gen_ai.usage.total_tokens 106
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id fef7d2ccf89e8697
parent_span_id invoke_agent eitl-review (9272028567c1…)
kind CLIENT
status OK
duration 1110ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Schedule the interview."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "tool_call", "id": "call_7xZIInIBFsh72f3ish5luK1U", "name"…
gen_ai.output.type json
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["tool_calls"]
gen_ai.response.id chatcmpl-DDwyTX28xMdnEybBDSiYmP5RGfsGH
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "schedule_interview", "description": "Schedule interview.…
gen_ai.usage.input_tokens 68
gen_ai.usage.output_tokens 25
gen_ai.usage.total_tokens 93
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 60841d17da774a63
parent_span_id invoke_agent summary-llm (a812af7a2be8…)
kind CLIENT
status OK
duration 1079ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Summarize the results in 1 sentence."}]}, {…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "All candidates were processed without …
gen_ai.output.type text
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["stop"]
gen_ai.response.id chatcmpl-DDwyT2hpm3qo231G7CASEMgjKhHyr
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.usage.input_tokens 26
gen_ai.usage.output_tokens 9
gen_ai.usage.total_tokens 35
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id faf52052e8fc60f2
parent_span_id invoke_agent worker-aurora (76a70af5ef33…)
kind CLIENT
status OK
duration 1178ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "tool_call", "id": "call_0RWeEW1vj0FvNUcVt0JmKf23", "name"…
gen_ai.output.type json
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["tool_calls"]
gen_ai.response.id chatcmpl-DDwyTX7N7bjw3mwNSU363EnwO2hgr
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 90
gen_ai.usage.output_tokens 17
gen_ai.usage.total_tokens 107
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

execute_tool schedule_interview

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id bbe649376fc99cd7
parent_span_id invoke_agent eitl-review (9272028567c1…)
kind INTERNAL
status OK
duration 306ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.operation.name execute_tool
gen_ai.provider.name azure.ai.openai
gen_ai.tool.call.arguments {"candidate": "Rose", "date": "2026-03-15"}
gen_ai.tool.call.result {"name": "schedule_interview", "tool_call_id": "call_7xZIInIBFsh72f3ish5luK1U", "content": "Intervie…
gen_ai.tool.description Schedule interview.
gen_ai.tool.name schedule_interview

execute_tool get_candidate_info

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 703c1e369dc87ee8
parent_span_id invoke_agent worker-rose (348447bdee54…)
kind INTERNAL
status OK
duration 505ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.operation.name execute_tool
gen_ai.provider.name azure.ai.openai
gen_ai.tool.call.arguments {"name": "Rose"}
gen_ai.tool.call.result {"name": "get_candidate_info", "tool_call_id": "call_tDKh3v7H7NzDVh41OWScLTf1", "content": "Candidat…
gen_ai.tool.description Look up candidate info.
gen_ai.tool.name get_candidate_info

execute_tool get_candidate_info

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 60d4e87fa593cf37
parent_span_id invoke_agent worker-aurora (76a70af5ef33…)
kind INTERNAL
status OK
duration 504ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.operation.name execute_tool
gen_ai.provider.name azure.ai.openai
gen_ai.tool.call.arguments {"name": "Aurora"}
gen_ai.tool.call.result {"name": "get_candidate_info", "tool_call_id": "call_0RWeEW1vj0FvNUcVt0JmKf23", "content": "Candidat…
gen_ai.tool.description Look up candidate info.
gen_ai.tool.name get_candidate_info

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 54619daff13c9656
parent_span_id invoke_agent eitl-review (9272028567c1…)
kind CLIENT
status OK
duration 551ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Schedule the interview."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "The interview for candidate Rose has b…
gen_ai.output.type text
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["stop"]
gen_ai.response.id chatcmpl-DDwyUmsKZaVacAxs93Ni56AgmQidw
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "schedule_interview", "description": "Schedule interview.…
gen_ai.usage.input_tokens 113
gen_ai.usage.output_tokens 19
gen_ai.usage.total_tokens 132
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id f2cefe314886777e
parent_span_id invoke_agent worker-rose (348447bdee54…)
kind CLIENT
status OK
duration 833ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "tool_call", "id": "call_9SAyKpRKsKp0mD3axFj9vzDQ", "name"…
gen_ai.output.type json
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["tool_calls"]
gen_ai.response.id chatcmpl-DDwyUdKknkQVZCZBPWDkkvlop0Ehu
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 125
gen_ai.usage.output_tokens 59
gen_ai.usage.total_tokens 184
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 51ac4b91422dc1f6
parent_span_id invoke_agent worker-aurora (76a70af5ef33…)
kind CLIENT
status OK
duration 964ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "tool_call", "id": "call_YUFaaYyI1uWy8CUKsN78dkXH", "name"…
gen_ai.output.type json
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["tool_calls"]
gen_ai.response.id chatcmpl-DDwyUDuUJuGmYIYE2tgccqRuHV2eF
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 126
gen_ai.usage.output_tokens 78
gen_ai.usage.total_tokens 204
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

execute_tool send_email

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 32bee92a4a127c15
parent_span_id invoke_agent worker-rose (348447bdee54…)
kind INTERNAL
status OK
duration 205ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.operation.name execute_tool
gen_ai.provider.name azure.ai.openai
gen_ai.tool.call.arguments {"to": "rose@example.com", "subject": "Application Confirmation", "body": "Dear Rose,\n\nThank you f…
gen_ai.tool.call.result {"name": "send_email", "tool_call_id": "call_9SAyKpRKsKp0mD3axFj9vzDQ", "content": "Email sent to ro…
gen_ai.tool.description Send email.
gen_ai.tool.name send_email

execute_tool send_email

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 442761d82cd97ff9
parent_span_id invoke_agent worker-aurora (76a70af5ef33…)
kind INTERNAL
status OK
duration 205ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.operation.name execute_tool
gen_ai.provider.name azure.ai.openai
gen_ai.tool.call.arguments {"to": "aurora@example.com", "subject": "Application Status", "body": "Dear Aurora,\n\nThank you for…
gen_ai.tool.call.result {"name": "send_email", "tool_call_id": "call_YUFaaYyI1uWy8CUKsN78dkXH", "content": "Email sent to au…
gen_ai.tool.description Send email.
gen_ai.tool.name send_email

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id abf77497a5bf1e90
parent_span_id invoke_agent worker-rose (348447bdee54…)
kind CLIENT
status OK
duration 822ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "Candidate Rose's information has been …
gen_ai.output.type text
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["stop"]
gen_ai.response.id chatcmpl-DDwyVYptIlr7ufc62LRQ0AdzNefm3
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 200
gen_ai.usage.output_tokens 22
gen_ai.usage.total_tokens 222
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

chat gpt-4o-2024-08-06

Field Value
trace_id 607584201bf61e4a4a3f80584b997551
span_id 5c5abb170e69e4f4
parent_span_id invoke_agent worker-aurora (76a70af5ef33…)
kind CLIENT
status OK
duration 756ms

Attributes:

Attribute Value
gen_ai.conversation.id job-12345
gen_ai.input.messages [{"role": "user", "parts": [{"type": "text", "content": "Process this candidate."}]}, {"role": "user…
gen_ai.operation.name chat
gen_ai.output.messages [{"role": "assistant", "parts": [{"type": "text", "content": "I have processed candidate Aurora. Her…
gen_ai.output.type text
gen_ai.provider.name azure.ai.openai
gen_ai.request.temperature 0.0
gen_ai.response.finish_reasons ["stop"]
gen_ai.response.id chatcmpl-DDwyWsO6s0iqY9w8sESEVry6CKsNP
gen_ai.response.model gpt-4o-2024-08-06
gen_ai.tool.definitions [{"type": "function", "function": {"name": "get_candidate_info", "description": "Look up candidate i…
gen_ai.usage.input_tokens 221
gen_ai.usage.output_tokens 23
gen_ai.usage.total_tokens 244
openai.response.system_fingerprint fp_e9b9b028d7
server.address ai-naarkalgaihub999971652049.openai.azure.com

GenAI Semantic Convention Compliance

Attributes follow OpenTelemetry GenAI Semantic Conventions.

Convention Attribute Status Notes
gen_ai.operation.name ✅ Required invoke_agent, chat, execute_tool
gen_ai.agent.name On all invoke_agent spans
gen_ai.agent.id Conditionally set when provided
gen_ai.agent.description Conditionally set when provided
gen_ai.request.model On chat spans
gen_ai.response.model On chat spans
gen_ai.response.id On chat spans
gen_ai.response.finish_reasons On chat spans
gen_ai.usage.input_tokens On chat + propagated to invoke_agent
gen_ai.usage.output_tokens On chat + propagated to invoke_agent
gen_ai.conversation.id Thread/session ID
gen_ai.input.messages ✅ opt-in When content recording enabled
gen_ai.output.messages ✅ opt-in When content recording enabled
gen_ai.system_instructions ✅ opt-in When content recording enabled
gen_ai.tool.definitions ✅ opt-in On chat spans with tools
gen_ai.tool.name On execute_tool spans
gen_ai.tool.call.id On execute_tool spans
gen_ai.tool.call.arguments ✅ opt-in When content recording enabled
gen_ai.tool.call.result ✅ opt-in When content recording enabled
gen_ai.provider.name azure.ai.openai
server.address Azure OpenAI endpoint
server.port Conditionally set
error.type On error spans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment