File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
azure/ai/agents/telemetry Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 38
38
GEN_AI_SYSTEM = "gen_ai.system"
39
39
SERVER_ADDRESS = "server.address"
40
40
AZ_AI_AGENT_SYSTEM = "az.ai.agents"
41
+ AZ_NAMESPACE = "az.namespace"
42
+ AZ_NAMESPACE_VALUE = "Microsoft.CognitiveServices"
41
43
GEN_AI_TOOL_NAME = "gen_ai.tool.name"
42
44
GEN_AI_TOOL_CALL_ID = "gen_ai.tool.call.id"
43
45
GEN_AI_REQUEST_RESPONSE_FORMAT = "gen_ai.request.response_format"
50
52
GEN_AI_RUN_STEP_STATUS = "gen_ai.run_step.status"
51
53
ERROR_TYPE = "error.type"
52
54
ERROR_MESSAGE = "error.message"
53
-
55
+ GEN_AI_SEMANTIC_CONVENTIONS_SCHEMA_VERSION = "1.34.0"
54
56
55
57
class OperationName (Enum ):
56
58
CREATE_AGENT = "create_agent"
@@ -114,9 +116,11 @@ def start_span(
114
116
if _span_impl_type is None :
115
117
return None
116
118
117
- span = _span_impl_type (name = span_name or operation_name .value , kind = kind )
119
+
120
+ span = _span_impl_type (name = span_name or operation_name .value , kind = kind , schema_version = GEN_AI_SEMANTIC_CONVENTIONS_SCHEMA_VERSION )
118
121
119
122
if span and span .span_instance .is_recording :
123
+ span .add_attribute (AZ_NAMESPACE , AZ_NAMESPACE_VALUE )
120
124
if gen_ai_system :
121
125
span .add_attribute (GEN_AI_SYSTEM , AZ_AI_AGENT_SYSTEM )
122
126
Original file line number Diff line number Diff line change 12
12
class GenAiTraceVerifier :
13
13
14
14
def check_span_attributes (self , span , attributes ):
15
+ assert "https://opentelemetry.io/schemas/1.34.0" == span .instrumentation_scope .schema_url
16
+
15
17
# Convert the list of tuples to a dictionary for easier lookup
16
18
attribute_dict = dict (attributes )
19
+ attribute_dict ["az.namespace" ] = "Microsoft.CognitiveServices"
17
20
18
21
for attribute_name in span .attributes .keys ():
19
22
# Check if the attribute name exists in the input attributes
You can’t perform that action at this time.
0 commit comments