Skip to content

Commit 70d752b

Browse files
committed
Fix test failure
1 parent 552c771 commit 70d752b

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
# Maximum allowed span size in bytes (250KB)
3131
MAX_SPAN_SIZE_BYTES = 250 * 1024
3232

33-
# Operation names that identify a span as a genAI span eligible for export to
34-
# the Agent 365 observability ingest service. Spans without a known
35-
# gen_ai.operation.name are filtered out of the export batch.
33+
# Operation names that identify a span as eligible for export to the Agent 365
34+
# observability ingest service. Only spans whose gen_ai.operation.name matches
35+
# one of these values are included; all other spans are filtered out.
3636
GEN_AI_OPERATION_NAMES: frozenset[str] = frozenset(
3737
{
3838
INVOKE_AGENT_OPERATION_NAME,
@@ -152,9 +152,10 @@ def filter_and_partition_by_identity(
152152
"""
153153
Filter export-eligible spans and partition them by (tenantId, agentId).
154154
155-
Only genAI spans (those with a known ``gen_ai.operation.name``) are
156-
included; non-genAI spans (e.g. HTTP, DB) are filtered out. Spans
157-
without both tenant and agent identity are also skipped.
155+
Only spans whose ``gen_ai.operation.name`` is in
156+
``GEN_AI_OPERATION_NAMES`` are included; non-genAI spans (e.g. HTTP, DB)
157+
and spans with other operation names are filtered out. Spans without
158+
both tenant and agent identity are also skipped.
158159
"""
159160
groups: dict[tuple[str, str], list[ReadableSpan]] = {}
160161
non_gen_ai_count = 0

tests/observability/core/test_agent365_exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ def test_export_error_logging(self, mock_logger):
358358
# Verify export succeeded (no identity spans are treated as success)
359359
self.assertEqual(result, SpanExportResult.SUCCESS)
360360

361-
# Verify info log for no identity
361+
# Verify info log for no eligible spans
362362
mock_logger.info.assert_called_with(
363-
"No spans with tenant/agent identity found; nothing exported."
363+
"No eligible genAI spans to export; nothing exported."
364364
)
365365

366366
def test_exporter_is_internal(self):

0 commit comments

Comments
 (0)