Skip to content

Add /otlp/ segment to observability exporter URL paths#225

Open
Copilot wants to merge 2 commits intomainfrom
copilot/implement-changes-from-pr-229
Open

Add /otlp/ segment to observability exporter URL paths#225
Copilot wants to merge 2 commits intomainfrom
copilot/implement-changes-from-pr-229

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Summary

  • Update Agent365Exporter to include /otlp/ in the trace export URL paths (both standard and S2S endpoints)
  • Aligns exporter routes with the OTLP endpoint naming convention: .../tenants/{tenantId}/otlp/agents/{agentId}/traces
  • Update corresponding test assertions to match the new URL format

Port of microsoft/Agent365-nodejs#229 to Python.

Changes

  • utils.py: Updated build_export_url() URL paths from .../tenants/{tenantId}/agents/{agentId}/traces to .../tenants/{tenantId}/otlp/agents/{agentId}/traces (both standard and S2S)
  • agent365_exporter.py: Updated docstring to reflect new URL format
  • test_agent365_exporter.py: Updated all 11 test assertions to match new URL format

Test plan

  • Updated existing exporter unit tests to validate new URL paths (19/19 passing)
  • Verify export succeeds against the updated service endpoints

Copilot AI requested a review from nikhilNava April 9, 2026 20:08
@nikhilNava nikhilNava marked this pull request as ready for review April 10, 2026 14:06
@nikhilNava nikhilNava requested a review from a team as a code owner April 10, 2026 14:06
Copilot AI review requested due to automatic review settings April 10, 2026 14:06
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 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.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 1428eeb.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

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

Updates the Agent365 observability HTTP exporter URL routing to include an /otlp/ path segment, aligning Python’s exporter endpoints with the service’s OTLP-style route naming.

Changes:

  • Update build_export_url() to emit .../tenants/{tenantId}/otlp/agents/{agentId}/traces (standard + S2S).
  • Refresh exporter docstring endpoint examples to reflect the new URL format.
  • Update unit test assertions to match the new URL paths.

Reviewed changes

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

File Description
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/utils.py Adds /otlp/ segment to constructed export paths.
libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py Updates docstring to reflect new endpoint routes.
tests/observability/core/test_agent365_exporter.py Updates expected URL strings in exporter tests for the new route format.
Comments suppressed due to low confidence (1)

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

  • build_export_url() concatenates endpoint and endpoint_path directly. If endpoint is configured with a trailing slash (e.g. https://example.com/) or includes a path (allowed today by get_validated_domain_override() for scheme URLs), this will produce URLs like https://example.com//observability/... or https://example.com/foo/observability/..., which can lead to incorrect routing/404s depending on the server. Consider normalizing endpoint (e.g., stripping trailing / and/or rejecting non-empty parsed.path for overrides) or constructing the URL via urllib.parse joins to avoid accidental double slashes/path stacking.
    endpoint_path = (
        f"/observabilityService/tenants/{tenant_id}/otlp/agents/{agent_id}/traces"
        if use_s2s_endpoint
        else f"/observability/tenants/{tenant_id}/otlp/agents/{agent_id}/traces"
    )

    parsed = urlparse(endpoint)
    if parsed.scheme and "://" in endpoint:
        return f"{endpoint}{endpoint_path}?api-version=1"
    return f"https://{endpoint}{endpoint_path}?api-version=1"

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.

3 participants