You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py
+90-28Lines changed: 90 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,10 @@
18
18
fromopentelemetry.traceimportStatusCode
19
19
20
20
from .utilsimport (
21
+
DEFAULT_MAX_PAYLOAD_BYTES,
21
22
build_export_url,
23
+
chunk_by_size,
24
+
estimate_span_bytes,
22
25
get_validated_domain_override,
23
26
hex_span_id,
24
27
hex_trace_id,
@@ -56,6 +59,7 @@ def __init__(
56
59
token_resolver: Callable[[str, str], str|None],
57
60
cluster_category: str="prod",
58
61
use_s2s_endpoint: bool=False,
62
+
max_payload_bytes: int=DEFAULT_MAX_PAYLOAD_BYTES,
59
63
):
60
64
iftoken_resolverisNone:
61
65
raiseValueError("token_resolver must be provided.")
Copy file name to clipboardExpand all lines: libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter_options.py
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
4
4
fromtypingimportAwaitable, Callable, Optional
5
5
6
+
from .utilsimportDEFAULT_MAX_PAYLOAD_BYTES
7
+
6
8
7
9
classAgent365ExporterOptions:
8
10
"""
@@ -19,6 +21,7 @@ def __init__(
19
21
scheduled_delay_ms: int=5000,
20
22
exporter_timeout_ms: int=30000,
21
23
max_export_batch_size: int=512,
24
+
max_payload_bytes: int=DEFAULT_MAX_PAYLOAD_BYTES,
22
25
):
23
26
"""
24
27
Args:
@@ -29,6 +32,10 @@ def __init__(
29
32
scheduled_delay_ms: Delay between export batches (ms). Default is 5000.
30
33
exporter_timeout_ms: Timeout for the export operation (ms). Default is 30000.
31
34
max_export_batch_size: Maximum batch size for export operations. Default is 512.
35
+
max_payload_bytes: Upper bound on HTTP request body size in bytes. The exporter
36
+
splits per-identity batches into sub-batches whose estimated size stays under
37
+
this limit, providing headroom under the A365 1 MB server limit. Default is
38
+
900_000 (~100 KB headroom for estimator error and JSON envelope overhead).
Copy file name to clipboardExpand all lines: libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py
0 commit comments