microsoft-agents-a365-observability-hosting 0.2.1.dev43__tar.gz → 0.2.1.dev45__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.
Files changed (21) hide show
  1. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/PKG-INFO +1 -1
  2. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/middleware/output_logging_middleware.py +14 -14
  3. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/scope_helpers/populate_baggage.py +2 -2
  4. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/scope_helpers/populate_invoke_agent_scope.py +2 -2
  5. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/scope_helpers/utils.py +11 -11
  6. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365_observability_hosting.egg-info/PKG-INFO +1 -1
  7. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/README.md +0 -0
  8. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/__init__.py +0 -0
  9. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/middleware/__init__.py +0 -0
  10. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/middleware/baggage_middleware.py +0 -0
  11. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/middleware/observability_hosting_manager.py +0 -0
  12. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/scope_helpers/__init__.py +0 -0
  13. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/token_cache_helpers/__init__.py +0 -0
  14. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365/observability/hosting/token_cache_helpers/agent_token_cache.py +0 -0
  15. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365_observability_hosting.egg-info/SOURCES.txt +0 -0
  16. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365_observability_hosting.egg-info/dependency_links.txt +0 -0
  17. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365_observability_hosting.egg-info/requires.txt +0 -0
  18. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/microsoft_agents_a365_observability_hosting.egg-info/top_level.txt +0 -0
  19. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/pyproject.toml +0 -0
  20. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/setup.cfg +0 -0
  21. {microsoft_agents_a365_observability_hosting-0.2.1.dev43 → microsoft_agents_a365_observability_hosting-0.2.1.dev45}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-a365-observability-hosting
3
- Version: 0.2.1.dev43
3
+ Version: 0.2.1.dev45
4
4
  Summary: Hosting components for Agent 365 observability
5
5
  Author-email: Microsoft <support@microsoft.com>
6
6
  License: MIT
@@ -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 _derive_source_metadata(
86
+ def _derive_channel(
87
87
  context: TurnContext,
88
88
  ) -> dict[str, str | None]:
89
- """Derive source metadata (channel name and description) from TurnContext."""
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, "description": sub_channel}
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
- source_metadata = _derive_source_metadata(context)
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
- source_metadata,
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
- source_metadata: dict[str, str | None],
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, source_metadata.get("name"))
201
- output_scope.set_tag_maybe(CHANNEL_LINK_KEY, source_metadata.get("description"))
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(GEN_AI_CALLER_ID_KEY, caller_details.caller_id)
205
- output_scope.set_tag_maybe(GEN_AI_CALLER_UPN_KEY, caller_details.caller_upn)
206
- output_scope.set_tag_maybe(GEN_AI_CALLER_NAME_KEY, caller_details.caller_name)
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 get_source_metadata_pairs(activity)
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(get_source_metadata_pairs(activity))
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 GEN_AI_CALLER_ID_KEY, frm.aad_object_id
42
- yield GEN_AI_CALLER_NAME_KEY, frm.name
43
- yield GEN_AI_CALLER_UPN_KEY, frm.agentic_user_id
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 GEN_AI_AGENT_UPN_KEY, activity.get_agentic_user()
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 get_source_metadata_pairs(activity: Activity) -> Iterator[tuple[str, Any]]:
77
+ def get_channel_pairs(activity: Activity) -> Iterator[tuple[str, Any]]:
78
78
  """
79
- Generate source metadata pairs from activity, handling both string and ChannelId object cases.
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 source metadata
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-a365-observability-hosting
3
- Version: 0.2.1.dev43
3
+ Version: 0.2.1.dev45
4
4
  Summary: Hosting components for Agent 365 observability
5
5
  Author-email: Microsoft <support@microsoft.com>
6
6
  License: MIT