Skip to content

Record full endpoint URLs on Agent365 execute-tool spans - #311

Merged
Nikhil Navakiran (nikhilNava) merged 6 commits into
mainfrom
copilot/a365-url-parity
Oct 30, 2026
Merged

Nikhil Navakiran (nikhilNava) merged 6 commits into
mainfrom
copilot/a365-url-parity

Conversation

@nikhilNava

Copy link
Copy Markdown
Collaborator

Summary

Port microsoft/opentelemetry-distro-dotnet#170 with a backward-compatible Python endpoint API.

  • Add optional trailing ServiceEndpoint.url and ServiceEndpoint.from_url(), deriving hostname and port from an absolute URL while retaining its full path/query.
  • Emit url.full only on execute-tool spans when explicitly supplied. Existing hostname/port endpoints remain unchanged; port 443 is still omitted.
  • Cover default/custom ports, IPv6, invalid URLs, and legacy endpoint behavior.
  • Document that URLs are emitted verbatim and must be sanitized by callers; URL recording is not gated by enable_sensitive_data.

No dependencies, inference endpoint behavior, exporter configuration, or storage policy change.

Validation

Python 3.11, with this branch's src on PYTHONPATH:

  • Regression tests failed before implementation, then passed.
  • python -m pytest tests/a365 --ignore=tests/a365/integration -q --tb=short: 649 passed, 8 skipped, 41 subtests passed.
  • Changed-file python -m pylint --output-format=parseable: passed (10/10).
  • Changed-file python -m mypy --python-version 3.10 --show-error-codes --ignore-missing-imports --check-untyped-defs --follow-imports=silent: passed.
  • Black formatting/check and git diff --check: passed.
  • python -m build --no-isolation: wheel and source distribution built; all three changed source files verified byte-for-byte in both artifacts.
  • Independent read-only review: no actionable introduced defects.

The unit run emits one exporter worker warning (enriching_span_processor.py:449, cannot release un-acquired lock). The exact warning reproduces on unchanged main (640 passed, 8 skipped, 41 subtests passed); this PR does not change exporters.

Full tox environments, Python 3.10/3.12-3.14 execution, live integration tests, Sphinx docs, and .NET/JavaScript execution were not run. No live telemetry was used.

This is an independent main-based PR. Existing Python storage work remains in #300.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dfa03945-cb0e-4471-ba78-5980a3098d0b

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.

🟢 Approval recommended

No active review issues block the opt-in endpoint URL recording change, though reported validation was not independently rerun.

No open issues 🎉

What changed in this PR

Adds opt-in full endpoint URL recording to Agent365 execute-tool spans while preserving existing hostname/port endpoints and leaving other scopes unchanged.

Changes:

  • Adds optional ServiceEndpoint.url and a from_url() constructor that derives hostname and port.
  • Emits url.full on execute-tool spans and tests URL parsing, port handling, IPv6, invalid inputs, and legacy behavior.
  • Documents caller-side sanitization and that URL recording is independent of enable_sensitive_data.

No actionable findings. Reported validation results were not independently rerun.

File Description
tests/​a365/​test_execute_tool_scope.py Adds URL recording, parsing, and backward-compatibility tests.
src/​microsoft/​opentelemetry/​a365/​core/​models/​service_endpoint.py Adds the optional URL field and URL-based constructor.
src/​microsoft/​opentelemetry/​a365/​core/​execute_tool_scope.py Records explicitly supplied endpoint URLs on tool spans.
src/​microsoft/​opentelemetry/​a365/​core/​constants.py Defines the url.full attribute key.
CHANGELOG.md Announces full endpoint URL support.
A365_DOCUMENTATION.md Documents usage, compatibility, and privacy responsibilities.

Review effort: Balanced

Comment thread CHANGELOG.md Resolved
Link the changelog to the Python PR and cover empty and malformed endpoint URLs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14661e89-86a3-4afe-a454-263eaeeba021

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.

🟢 Approval recommended

No active review issues remain for the opt-in endpoint URL recording change.

No open issues 🎉

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dfa03945-cb0e-4471-ba78-5980a3098d0b
Copilot AI balanced review requested due to automatic review settings October 28, 2026 22:03

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.

🟢 Approval recommended

No active review issues were identified for the endpoint URL recording change.

No open issues 🎉

Review effort: Balanced

@nikhilNava

Copy link
Copy Markdown
Collaborator Author

Copilot resolve the merge conflicts in this pull request

# Conflicts:
#	CHANGELOG.md

Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 21:01

Copilot AI commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

Resolved the conflict with main, preserving both the Agent365 storage changelog and the endpoint URL entry. Merge commit: 3e57c4e.

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.

🟢 Approval recommended

No active review issues block the addition of full endpoint URL recording to execute-tool spans.

No open issues 🎉

Review effort: Balanced

Select the released OpenAIChatCompletionClient instead of the Responses client and pass the configured Azure API version explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14661e89-86a3-4afe-a454-263eaeeba021
Copilot AI balanced review requested due to automatic review settings October 30, 2026 16:41
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Performance comparison

Threshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.

Scenario Gating Baseline (ops/s) Candidate (ops/s) Δ % Status
azure_monitor_log yes 29,384.1 28,618.9 +2.67% ✅
azure_monitor_span yes 214,339.3 206,377.1 +3.86% ✅
otel_log no 33,298.9 33,493.0 -0.58% ✅
otel_span no 65,937.0 64,478.7 +2.26% ✅

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.

🟢 Approval recommended

No active review issues remain for the endpoint URL recording change.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 30, 2026 17:34

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.

🟢 Approval recommended

No active review issues remain for the opt-in endpoint URL recording change.

No open issues 🎉

Review effort: Balanced

@nikhilNava
Nikhil Navakiran (nikhilNava) merged commit 3e753bc into main Oct 30, 2026
16 checks passed
@nikhilNava
Nikhil Navakiran (nikhilNava) deleted the copilot/a365-url-parity branch October 30, 2026 17:55
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