microsoft-agents-a365-observability-hosting 0.2.1.dev42__tar.gz → 0.2.1.dev43__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.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/PKG-INFO +1 -1
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/__init__.py +5 -2
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/middleware/__init__.py +2 -2
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/middleware/output_logging_middleware.py +12 -8
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365_observability_hosting.egg-info/PKG-INFO +1 -1
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/README.md +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/middleware/baggage_middleware.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/middleware/observability_hosting_manager.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/scope_helpers/__init__.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/scope_helpers/populate_baggage.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/scope_helpers/populate_invoke_agent_scope.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/scope_helpers/utils.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/token_cache_helpers/__init__.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365/observability/hosting/token_cache_helpers/agent_token_cache.py +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365_observability_hosting.egg-info/SOURCES.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365_observability_hosting.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365_observability_hosting.egg-info/requires.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/microsoft_agents_a365_observability_hosting.egg-info/top_level.txt +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/pyproject.toml +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/setup.cfg +0 -0
- {microsoft_agents_a365_observability_hosting-0.2.1.dev42 → microsoft_agents_a365_observability_hosting-0.2.1.dev43}/setup.py +0 -0
|
@@ -10,12 +10,15 @@ from .middleware.observability_hosting_manager import (
|
|
|
10
10
|
ObservabilityHostingManager,
|
|
11
11
|
ObservabilityHostingOptions,
|
|
12
12
|
)
|
|
13
|
-
from .middleware.output_logging_middleware import
|
|
13
|
+
from .middleware.output_logging_middleware import (
|
|
14
|
+
A365_PARENT_TRACEPARENT_KEY,
|
|
15
|
+
OutputLoggingMiddleware,
|
|
16
|
+
)
|
|
14
17
|
|
|
15
18
|
__all__ = [
|
|
16
19
|
"BaggageMiddleware",
|
|
17
20
|
"OutputLoggingMiddleware",
|
|
18
|
-
"
|
|
21
|
+
"A365_PARENT_TRACEPARENT_KEY",
|
|
19
22
|
"ObservabilityHostingManager",
|
|
20
23
|
"ObservabilityHostingOptions",
|
|
21
24
|
]
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
from .baggage_middleware import BaggageMiddleware
|
|
5
5
|
from .observability_hosting_manager import ObservabilityHostingManager, ObservabilityHostingOptions
|
|
6
|
-
from .output_logging_middleware import
|
|
6
|
+
from .output_logging_middleware import A365_PARENT_TRACEPARENT_KEY, OutputLoggingMiddleware
|
|
7
7
|
|
|
8
8
|
__all__ = [
|
|
9
9
|
"BaggageMiddleware",
|
|
10
10
|
"OutputLoggingMiddleware",
|
|
11
|
-
"
|
|
11
|
+
"A365_PARENT_TRACEPARENT_KEY",
|
|
12
12
|
"ObservabilityHostingManager",
|
|
13
13
|
"ObservabilityHostingOptions",
|
|
14
14
|
]
|
|
@@ -24,6 +24,7 @@ from microsoft_agents_a365.observability.core.models.caller_details import Calle
|
|
|
24
24
|
from microsoft_agents_a365.observability.core.models.response import Response
|
|
25
25
|
from microsoft_agents_a365.observability.core.spans_scopes.output_scope import OutputScope
|
|
26
26
|
from microsoft_agents_a365.observability.core.tenant_details import TenantDetails
|
|
27
|
+
from microsoft_agents_a365.observability.core.utils import extract_context_from_headers
|
|
27
28
|
|
|
28
29
|
from ..scope_helpers.utils import (
|
|
29
30
|
get_execution_type_pair,
|
|
@@ -31,8 +32,8 @@ from ..scope_helpers.utils import (
|
|
|
31
32
|
|
|
32
33
|
logger = logging.getLogger(__name__)
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
# TurnState key for the parent trace context (W3C traceparent string).
|
|
36
|
+
A365_PARENT_TRACEPARENT_KEY = "A365ParentTraceparent"
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
def _derive_agent_details(context: TurnContext) -> AgentDetails | None:
|
|
@@ -109,7 +110,7 @@ def _derive_execution_type(context: TurnContext) -> str | None:
|
|
|
109
110
|
class OutputLoggingMiddleware:
|
|
110
111
|
"""Middleware that creates :class:`OutputScope` spans for outgoing messages.
|
|
111
112
|
|
|
112
|
-
Links to a parent span when :data:`
|
|
113
|
+
Links to a parent span when :data:`A365_PARENT_TRACEPARENT_KEY` is set in
|
|
113
114
|
``turn_state``.
|
|
114
115
|
|
|
115
116
|
**Privacy note:** Outgoing message content is captured verbatim as span
|
|
@@ -175,19 +176,22 @@ class OutputLoggingMiddleware:
|
|
|
175
176
|
await send_next()
|
|
176
177
|
return
|
|
177
178
|
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
traceparent: str | None = turn_context.turn_state.get(A365_PARENT_TRACEPARENT_KEY)
|
|
180
|
+
parent_context = None
|
|
181
|
+
if traceparent:
|
|
182
|
+
parent_context = extract_context_from_headers({"traceparent": traceparent})
|
|
183
|
+
else:
|
|
180
184
|
logger.warning(
|
|
181
|
-
"[OutputLoggingMiddleware] No
|
|
185
|
+
"[OutputLoggingMiddleware] No traceparent in turn_state under "
|
|
182
186
|
"'%s'. OutputScope will not be linked to a parent.",
|
|
183
|
-
|
|
187
|
+
A365_PARENT_TRACEPARENT_KEY,
|
|
184
188
|
)
|
|
185
189
|
|
|
186
190
|
output_scope = OutputScope.start(
|
|
187
191
|
agent_details=agent_details,
|
|
188
192
|
tenant_details=tenant_details,
|
|
189
193
|
response=Response(messages=messages),
|
|
190
|
-
|
|
194
|
+
parent_context=parent_context,
|
|
191
195
|
)
|
|
192
196
|
|
|
193
197
|
# Set additional attributes on the scope
|
|
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
|
|
File without changes
|