microsoft-agents-a365-observability-hosting 0.2.1.dev43__tar.gz → 0.2.1.dev44__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/PKG-INFO +1 -1
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/middleware/output_logging_middleware.py +14 -14
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/scope_helpers/populate_baggage.py +2 -2
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/scope_helpers/populate_invoke_agent_scope.py +2 -2
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/scope_helpers/utils.py +11 -11
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365_observability_hosting.egg-info/PKG-INFO +1 -1
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/README.md +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/__init__.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/middleware/__init__.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/middleware/baggage_middleware.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/middleware/observability_hosting_manager.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/scope_helpers/__init__.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/token_cache_helpers/__init__.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365/observability/hosting/token_cache_helpers/agent_token_cache.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365_observability_hosting.egg-info/SOURCES.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365_observability_hosting.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365_observability_hosting.egg-info/requires.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/microsoft_agents_a365_observability_hosting.egg-info/top_level.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/pyproject.toml +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/setup.cfg +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev44}/setup.py +0 -0
|
@@ -14,11 +14,11 @@ from microsoft_agents_a365.observability.core.agent_details import AgentDetails
|
|
|
14
14
|
from microsoft_agents_a365.observability.core.constants import (
|
|
15
15
|
CHANNEL_LINK_KEY,
|
|
16
16
|
CHANNEL_NAME_KEY,
|
|
17
|
-
GEN_AI_CALLER_ID_KEY,
|
|
18
|
-
GEN_AI_CALLER_NAME_KEY,
|
|
19
|
-
GEN_AI_CALLER_UPN_KEY,
|
|
20
17
|
GEN_AI_CONVERSATION_ID_KEY,
|
|
21
18
|
GEN_AI_EXECUTION_TYPE_KEY,
|
|
19
|
+
USER_EMAIL_KEY,
|
|
20
|
+
USER_ID_KEY,
|
|
21
|
+
USER_NAME_KEY,
|
|
22
22
|
)
|
|
23
23
|
from microsoft_agents_a365.observability.core.models.caller_details import CallerDetails
|
|
24
24
|
from microsoft_agents_a365.observability.core.models.response import Response
|
|
@@ -83,10 +83,10 @@ def _derive_conversation_id(context: TurnContext) -> str | None:
|
|
|
83
83
|
return conv.id if conv else None
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
def
|
|
86
|
+
def _derive_channel(
|
|
87
87
|
context: TurnContext,
|
|
88
88
|
) -> dict[str, str | None]:
|
|
89
|
-
"""Derive
|
|
89
|
+
"""Derive channel (name and link) from TurnContext."""
|
|
90
90
|
channel_id = getattr(context.activity, "channel_id", None)
|
|
91
91
|
channel_name: str | None = None
|
|
92
92
|
sub_channel: str | None = None
|
|
@@ -96,7 +96,7 @@ def _derive_source_metadata(
|
|
|
96
96
|
elif hasattr(channel_id, "channel"):
|
|
97
97
|
channel_name = channel_id.channel
|
|
98
98
|
sub_channel = channel_id.sub_channel
|
|
99
|
-
return {"name": channel_name, "
|
|
99
|
+
return {"name": channel_name, "link": sub_channel}
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
def _derive_execution_type(context: TurnContext) -> str | None:
|
|
@@ -131,7 +131,7 @@ class OutputLoggingMiddleware:
|
|
|
131
131
|
|
|
132
132
|
caller_details = _derive_caller_details(context)
|
|
133
133
|
conversation_id = _derive_conversation_id(context)
|
|
134
|
-
|
|
134
|
+
channel = _derive_channel(context)
|
|
135
135
|
execution_type = _derive_execution_type(context)
|
|
136
136
|
|
|
137
137
|
context.on_send_activities(
|
|
@@ -141,7 +141,7 @@ class OutputLoggingMiddleware:
|
|
|
141
141
|
tenant_details,
|
|
142
142
|
caller_details,
|
|
143
143
|
conversation_id,
|
|
144
|
-
|
|
144
|
+
channel,
|
|
145
145
|
execution_type,
|
|
146
146
|
)
|
|
147
147
|
)
|
|
@@ -155,7 +155,7 @@ class OutputLoggingMiddleware:
|
|
|
155
155
|
tenant_details: TenantDetails,
|
|
156
156
|
caller_details: CallerDetails | None,
|
|
157
157
|
conversation_id: str | None,
|
|
158
|
-
|
|
158
|
+
channel: dict[str, str | None],
|
|
159
159
|
execution_type: str | None,
|
|
160
160
|
) -> Callable:
|
|
161
161
|
"""Create a send handler that wraps outgoing messages in OutputScope spans.
|
|
@@ -197,13 +197,13 @@ class OutputLoggingMiddleware:
|
|
|
197
197
|
# Set additional attributes on the scope
|
|
198
198
|
output_scope.set_tag_maybe(GEN_AI_CONVERSATION_ID_KEY, conversation_id)
|
|
199
199
|
output_scope.set_tag_maybe(GEN_AI_EXECUTION_TYPE_KEY, execution_type)
|
|
200
|
-
output_scope.set_tag_maybe(CHANNEL_NAME_KEY,
|
|
201
|
-
output_scope.set_tag_maybe(CHANNEL_LINK_KEY,
|
|
200
|
+
output_scope.set_tag_maybe(CHANNEL_NAME_KEY, channel.get("name"))
|
|
201
|
+
output_scope.set_tag_maybe(CHANNEL_LINK_KEY, channel.get("link"))
|
|
202
202
|
|
|
203
203
|
if caller_details:
|
|
204
|
-
output_scope.set_tag_maybe(
|
|
205
|
-
output_scope.set_tag_maybe(
|
|
206
|
-
output_scope.set_tag_maybe(
|
|
204
|
+
output_scope.set_tag_maybe(USER_ID_KEY, caller_details.caller_id)
|
|
205
|
+
output_scope.set_tag_maybe(USER_EMAIL_KEY, caller_details.caller_upn)
|
|
206
|
+
output_scope.set_tag_maybe(USER_NAME_KEY, caller_details.caller_name)
|
|
207
207
|
|
|
208
208
|
try:
|
|
209
209
|
await send_next()
|
|
@@ -11,9 +11,9 @@ from microsoft_agents_a365.observability.core.middleware.baggage_builder import
|
|
|
11
11
|
|
|
12
12
|
from .utils import (
|
|
13
13
|
get_caller_pairs,
|
|
14
|
+
get_channel_pairs,
|
|
14
15
|
get_conversation_pairs,
|
|
15
16
|
get_execution_type_pair,
|
|
16
|
-
get_source_metadata_pairs,
|
|
17
17
|
get_target_agent_pairs,
|
|
18
18
|
get_tenant_id_pair,
|
|
19
19
|
)
|
|
@@ -27,7 +27,7 @@ def _iter_all_pairs(turn_context: TurnContext) -> Iterator[tuple[str, Any]]:
|
|
|
27
27
|
yield from get_execution_type_pair(activity)
|
|
28
28
|
yield from get_target_agent_pairs(activity)
|
|
29
29
|
yield from get_tenant_id_pair(activity)
|
|
30
|
-
yield from
|
|
30
|
+
yield from get_channel_pairs(activity)
|
|
31
31
|
yield from get_conversation_pairs(activity)
|
|
32
32
|
|
|
33
33
|
|
|
@@ -9,9 +9,9 @@ from microsoft_agents_a365.observability.core.invoke_agent_scope import InvokeAg
|
|
|
9
9
|
|
|
10
10
|
from .utils import (
|
|
11
11
|
get_caller_pairs,
|
|
12
|
+
get_channel_pairs,
|
|
12
13
|
get_conversation_pairs,
|
|
13
14
|
get_execution_type_pair,
|
|
14
|
-
get_source_metadata_pairs,
|
|
15
15
|
get_target_agent_pairs,
|
|
16
16
|
get_tenant_id_pair,
|
|
17
17
|
)
|
|
@@ -39,7 +39,7 @@ def populate(scope: InvokeAgentScope, turn_context: TurnContext) -> InvokeAgentS
|
|
|
39
39
|
scope.record_attributes(get_execution_type_pair(activity))
|
|
40
40
|
scope.record_attributes(get_target_agent_pairs(activity))
|
|
41
41
|
scope.record_attributes(get_tenant_id_pair(activity))
|
|
42
|
-
scope.record_attributes(
|
|
42
|
+
scope.record_attributes(get_channel_pairs(activity))
|
|
43
43
|
scope.record_attributes(get_conversation_pairs(activity))
|
|
44
44
|
|
|
45
45
|
if activity.text:
|
|
@@ -9,16 +9,16 @@ from microsoft_agents_a365.observability.core.constants import (
|
|
|
9
9
|
CHANNEL_NAME_KEY,
|
|
10
10
|
GEN_AI_AGENT_AUID_KEY,
|
|
11
11
|
GEN_AI_AGENT_DESCRIPTION_KEY,
|
|
12
|
+
GEN_AI_AGENT_EMAIL_KEY,
|
|
12
13
|
GEN_AI_AGENT_ID_KEY,
|
|
13
14
|
GEN_AI_AGENT_NAME_KEY,
|
|
14
|
-
GEN_AI_AGENT_UPN_KEY,
|
|
15
|
-
GEN_AI_CALLER_ID_KEY,
|
|
16
|
-
GEN_AI_CALLER_NAME_KEY,
|
|
17
|
-
GEN_AI_CALLER_UPN_KEY,
|
|
18
15
|
GEN_AI_CONVERSATION_ID_KEY,
|
|
19
16
|
GEN_AI_CONVERSATION_ITEM_LINK_KEY,
|
|
20
17
|
GEN_AI_EXECUTION_TYPE_KEY,
|
|
21
18
|
TENANT_ID_KEY,
|
|
19
|
+
USER_EMAIL_KEY,
|
|
20
|
+
USER_ID_KEY,
|
|
21
|
+
USER_NAME_KEY,
|
|
22
22
|
)
|
|
23
23
|
from microsoft_agents_a365.observability.core.execution_type import ExecutionType
|
|
24
24
|
|
|
@@ -38,9 +38,9 @@ def get_caller_pairs(activity: Activity) -> Iterator[tuple[str, Any]]:
|
|
|
38
38
|
frm = activity.from_property
|
|
39
39
|
if not frm:
|
|
40
40
|
return
|
|
41
|
-
yield
|
|
42
|
-
yield
|
|
43
|
-
yield
|
|
41
|
+
yield USER_ID_KEY, frm.aad_object_id
|
|
42
|
+
yield USER_NAME_KEY, frm.name
|
|
43
|
+
yield USER_EMAIL_KEY, frm.agentic_user_id
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
def get_execution_type_pair(activity: Activity) -> Iterator[tuple[str, Any]]:
|
|
@@ -63,7 +63,7 @@ def get_target_agent_pairs(activity: Activity) -> Iterator[tuple[str, Any]]:
|
|
|
63
63
|
yield GEN_AI_AGENT_ID_KEY, activity.get_agentic_instance_id()
|
|
64
64
|
yield GEN_AI_AGENT_NAME_KEY, rec.name
|
|
65
65
|
yield GEN_AI_AGENT_AUID_KEY, rec.aad_object_id
|
|
66
|
-
yield
|
|
66
|
+
yield GEN_AI_AGENT_EMAIL_KEY, activity.get_agentic_user()
|
|
67
67
|
yield (
|
|
68
68
|
GEN_AI_AGENT_DESCRIPTION_KEY,
|
|
69
69
|
rec.role,
|
|
@@ -74,12 +74,12 @@ def get_tenant_id_pair(activity: Activity) -> Iterator[tuple[str, Any]]:
|
|
|
74
74
|
yield TENANT_ID_KEY, activity.recipient.tenant_id
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
def
|
|
77
|
+
def get_channel_pairs(activity: Activity) -> Iterator[tuple[str, Any]]:
|
|
78
78
|
"""
|
|
79
|
-
Generate
|
|
79
|
+
Generate channel pairs from activity, handling both string and ChannelId object cases.
|
|
80
80
|
|
|
81
81
|
:param activity: The activity object (Activity instance or dict)
|
|
82
|
-
:return: Iterator of (key, value) tuples for
|
|
82
|
+
:return: Iterator of (key, value) tuples for channel information
|
|
83
83
|
"""
|
|
84
84
|
# Handle channel_id (can be string or ChannelId object)
|
|
85
85
|
channel_id = activity.channel_id
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|