Skip to content

Filter A365 exports to only include genAI spans ADO#37660292#247

Merged
alexlu4250 merged 7 commits intomainfrom
feature/filter-genai-spans
Apr 29, 2026
Merged

Filter A365 exports to only include genAI spans ADO#37660292#247
alexlu4250 merged 7 commits intomainfrom
feature/filter-genai-spans

Conversation

@alexlu4250
Copy link
Copy Markdown
Contributor

@alexlu4250 alexlu4250 commented Apr 27, 2026

Filter A365 exports to only include genAI spans
ADO#37660292 Task 37660292: [Python] Ensure a365 exports only genAI spans

Copilot AI review requested due to automatic review settings April 27, 2026 21:43
@alexlu4250 alexlu4250 requested a review from a team as a code owner April 27, 2026 21:43
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.name before 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.

fpfp100
fpfp100 previously approved these changes Apr 27, 2026
Copilot AI review requested due to automatic review settings April 28, 2026 21:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" when groups is empty, but groups can now be empty because spans were filtered out as non-export-eligible (unknown/missing gen_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

Comment thread tests/observability/core/test_agent365_exporter.py Outdated
Comment thread tests/observability/core/test_agent365_exporter.py
fpfp100
fpfp100 previously approved these changes Apr 28, 2026
Copilot AI review requested due to automatic review settings April 29, 2026 06:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/unsupported gen_ai.operation.name), groups becomes 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

@alexlu4250 alexlu4250 force-pushed the feature/filter-genai-spans branch from 91d0c69 to a14bbf7 Compare April 29, 2026 16:38
Copilot AI review requested due to automatic review settings April 29, 2026 16:59
@alexlu4250 alexlu4250 force-pushed the feature/filter-genai-spans branch from a14bbf7 to 18ba116 Compare April 29, 2026 16:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@alexlu4250 alexlu4250 force-pushed the feature/filter-genai-spans branch from 18ba116 to 6a49f52 Compare April 29, 2026 18:10
fpfp100
fpfp100 previously approved these changes Apr 29, 2026
Copilot AI review requested due to automatic review settings April 29, 2026 18:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings April 29, 2026 20:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

@alexlu4250 alexlu4250 enabled auto-merge (squash) April 29, 2026 21:17
@alexlu4250 alexlu4250 force-pushed the feature/filter-genai-spans branch from c9412a3 to 297e54a Compare April 29, 2026 21:22
@alexlu4250 alexlu4250 merged commit b1825b9 into main Apr 29, 2026
9 checks passed
@alexlu4250 alexlu4250 deleted the feature/filter-genai-spans branch April 29, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants