Add /otlp/ segment to observability exporter URL paths#225
Open
Add /otlp/ segment to observability exporter URL paths#225
Conversation
Agent-Logs-Url: https://github.com/microsoft/Agent365-python/sessions/15f00c02-8b53-473e-857f-ad6ba3a9e1bb Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
nikhilNava
April 9, 2026 20:08
View session
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure 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 FilesNone |
Contributor
There was a problem hiding this comment.
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()concatenatesendpointandendpoint_pathdirectly. Ifendpointis configured with a trailing slash (e.g.https://example.com/) or includes a path (allowed today byget_validated_domain_override()for scheme URLs), this will produce URLs likehttps://example.com//observability/...orhttps://example.com/foo/observability/..., which can lead to incorrect routing/404s depending on the server. Consider normalizingendpoint(e.g., stripping trailing/and/or rejecting non-emptyparsed.pathfor overrides) or constructing the URL viaurllib.parsejoins 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"
...5-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter.py
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent365Exporterto include/otlp/in the trace export URL paths (both standard and S2S endpoints).../tenants/{tenantId}/otlp/agents/{agentId}/tracesPort of microsoft/Agent365-nodejs#229 to Python.
Changes
utils.py: Updatedbuild_export_url()URL paths from.../tenants/{tenantId}/agents/{agentId}/tracesto.../tenants/{tenantId}/otlp/agents/{agentId}/traces(both standard and S2S)agent365_exporter.py: Updated docstring to reflect new URL formattest_agent365_exporter.py: Updated all 11 test assertions to match new URL formatTest plan