Skip to content

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

Merged
Jianbiao Lu (alexlu4250) merged 7 commits into
mainfrom
feature/filter-genai-spans
Apr 29, 2026
Merged

Filter A365 exports to only include genAI spans ADO#37660292#247
Jianbiao Lu (alexlu4250) merged 7 commits into
mainfrom
feature/filter-genai-spans

Conversation

@alexlu4250

@alexlu4250 Jianbiao Lu (alexlu4250) commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

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
Jianbiao Lu (alexlu4250) requested a review from a team as a code owner April 27, 2026 21:43
@github-actions

github-actions Bot commented Apr 27, 2026

Copy link
Copy Markdown

⚠️ 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

Copilot AI review requested due to automatic review settings April 29, 2026 16:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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
Jianbiao Lu (alexlu4250) enabled auto-merge (squash) April 29, 2026 21:17
@alexlu4250
Jianbiao Lu (alexlu4250) merged commit b1825b9 into main Apr 29, 2026
9 checks passed
@alexlu4250
Jianbiao Lu (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