Filter A365 exports to only include genAI spans ADO#37660292#247
Filter A365 exports to only include genAI spans ADO#37660292#247alexlu4250 merged 7 commits intomainfrom
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR updates the Agent365 exporter pipeline so that only spans identified as “genAI” (via gen_ai.operation.name) are eligible for export to the A365 ingest endpoint, with additional normalization for inference operation values to the canonical operation name expected by the service.
Changes:
- Add an allowlist-based filter in exporter utilities to drop spans without an eligible
gen_ai.operation.namebefore partitioning/export. - Normalize inference operation name enum values (
Chat,TextCompletion,GenerateContent) to the canonical"chat"in the exported payload. - Extend exporter unit tests to validate filtering behavior and operation-name normalization.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/observability/core/test_agent365_exporter.py | Adds tests ensuring non-eligible spans are filtered and inference operation names are normalized in the export payload. |
| libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py | Introduces allowlisted genAI operation-name filtering during identity partitioning and adds related logging. |
| libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py | Normalizes inference operation-name enum values to canonical "chat" during span mapping for export. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py:82
export()logs "No spans with tenant/agent identity found" whengroupsis empty, butgroupscan now be empty because spans were filtered out as non-export-eligible (unknown/missinggen_ai.operation.name), even if tenant/agent identity exists. Consider updating the log message (and corresponding test expectations) to reflect "no export-eligible genAI spans" rather than "no identity" so troubleshooting is accurate.
if not groups:
# No spans with identity; treat as success
logger.info("No spans with tenant/agent identity found; nothing exported.")
return SpanExportResult.SUCCESS
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py:87
- When
filter_and_partition_by_identity()filters out all spans (e.g., missing/unsupportedgen_ai.operation.name),groupsbecomes empty and the exporter logs "No spans with tenant/agent identity found". That message is now misleading because identity may be present but spans were filtered as non-export-eligible. Consider updating the log text (and possibly its level) to reflect "no export-eligible spans" / "all spans filtered out" so operators can diagnose why nothing was exported.
if not groups:
# No spans with identity; treat as success
logger.info("No spans with tenant/agent identity found; nothing exported.")
return SpanExportResult.SUCCESS
91d0c69 to
a14bbf7
Compare
a14bbf7 to
18ba116
Compare
18ba116 to
6a49f52
Compare
c9412a3 to
297e54a
Compare
Filter A365 exports to only include genAI spans
ADO#37660292 Task 37660292: [Python] Ensure a365 exports only genAI spans