Skip to content

Commit 4e850bf

Browse files
CopilotnikhilNava
andcommitted
Remove GEN_AI_EXECUTION_SOURCE_NAME_KEY, GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY, and GEN_AI_EVENT_CONTENT constants
Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
1 parent 081737a commit 4e850bf

3 files changed

Lines changed: 6 additions & 26 deletions

File tree

  • libraries
    • microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core
    • microsoft-agents-a365-observability-extensions-agentframework/microsoft_agents_a365/observability/extensions/agentframework

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/constants.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@
9494
CHANNEL_NAME_KEY = "microsoft.channel.name"
9595
CHANNEL_LINK_KEY = "microsoft.channel.link"
9696

97-
# Deprecated channel dimension keys - use CHANNEL_NAME_KEY and CHANNEL_LINK_KEY instead
98-
GEN_AI_EXECUTION_SOURCE_NAME_KEY = "microsoft.channel.name"
99-
GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY = "microsoft.channel.link"
100-
101-
# Event content key
102-
GEN_AI_EVENT_CONTENT = "gen_ai.event.content"
103-
10497
# Custom parent id and parent name key
10598
CUSTOM_PARENT_SPAN_ID_KEY = "custom.parent.span.id"
10699
CUSTOM_SPAN_NAME_KEY = "custom.span.name"

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/execute_tool_scope.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
from .agent_details import AgentDetails
77
from .constants import (
8+
CHANNEL_LINK_KEY,
9+
CHANNEL_NAME_KEY,
810
EXECUTE_TOOL_OPERATION_NAME,
9-
GEN_AI_EVENT_CONTENT,
10-
GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY,
11-
GEN_AI_EXECUTION_SOURCE_NAME_KEY,
1211
GEN_AI_TOOL_ARGS_KEY,
1312
GEN_AI_TOOL_CALL_ID_KEY,
1413
GEN_AI_TOOL_DESCRIPTION_KEY,
@@ -115,15 +114,13 @@ def __init__(
115114

116115
# Set request metadata if provided
117116
if request and request.source_metadata:
118-
self.set_tag_maybe(GEN_AI_EXECUTION_SOURCE_NAME_KEY, request.source_metadata.name)
119-
self.set_tag_maybe(
120-
GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY, request.source_metadata.description
121-
)
117+
self.set_tag_maybe(CHANNEL_NAME_KEY, request.source_metadata.name)
118+
self.set_tag_maybe(CHANNEL_LINK_KEY, request.source_metadata.description)
122119

123120
def record_response(self, response: str) -> None:
124121
"""Records response information for telemetry tracking.
125122
126123
Args:
127124
response: The response to record
128125
"""
129-
self.set_tag_maybe(GEN_AI_EVENT_CONTENT, response)
126+
pass # GEN_AI_EVENT_CONTENT removed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33

4-
from microsoft_agents_a365.observability.core.constants import (
5-
EXECUTE_TOOL_OPERATION_NAME,
6-
GEN_AI_EVENT_CONTENT,
7-
GEN_AI_OPERATION_NAME_KEY,
8-
)
94
from opentelemetry.sdk.trace.export import SpanProcessor
105

116

@@ -21,12 +16,7 @@ def __init__(self, service_name: str | None = None):
2116
super().__init__()
2217

2318
def on_start(self, span, parent_context):
24-
if hasattr(span, "attributes"):
25-
operation_name = span.attributes.get(GEN_AI_OPERATION_NAME_KEY)
26-
if isinstance(operation_name, str) and operation_name == EXECUTE_TOOL_OPERATION_NAME:
27-
tool_call_result = span.attributes.get(self.TOOL_CALL_RESULT_TAG)
28-
if tool_call_result is not None:
29-
span.set_attribute(GEN_AI_EVENT_CONTENT, tool_call_result)
19+
pass
3020

3121
def on_end(self, span):
3222
pass

0 commit comments

Comments
 (0)