Skip to content

Documentation improvements for published API reference#214

Merged
nikhilNava merged 2 commits into
mainfrom
copilot/fix-documentation-improvements
Jun 22, 2026
Merged

Documentation improvements for published API reference#214
nikhilNava merged 2 commits into
mainfrom
copilot/fix-documentation-improvements

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

The published reference docs (learn.microsoft.com/python/api/microsoft-opentelemetry) have broken cross-references, missing module/enum descriptions, internal-only notes, and a malformed docstring. These changes fix the docstrings and comments that drive doc generation.

Cross-references

Fully-qualify :func:/:class:/:meth:/:data: targets so the docfx build resolves them instead of emitting "Cross reference not found":

  • use_microsoft_opentelemetry (opentelemetry/__init__.py)
  • OpenTelemetryScope.inject_context_to_headers (a365/core/utils.py)
  • OutputScope, A365_PARENT_TRACEPARENT_KEY (output_logging_middleware.py; also propagates to the re-exported middleware.* / hosting.* views)
# before — bare name, unresolved in published docs
""":func:`use_microsoft_opentelemetry`"""
# after — fully-qualified UID
""":func:`microsoft.opentelemetry.use_microsoft_opentelemetry`"""

Descriptions & content

  • Enum/value members now documented via #: comments: MessageRole, FinishReason, Modality, ToolType, InferenceOperationType, GuardrailDecisionType, GuardrailRiskSeverity, GuardrailTargetType.
  • Added package/module docstrings to a365/core, a365/langchain (was empty), a365/runtime, and a365/core/constants.py — bringing them in line with hosting.
  • A365_PARENT_TRACEPARENT_KEY given a doc comment so it renders as a documented, linkable target.

Internal-facing text

Removed "Vendored from microsoft-agents-a365-observability*" lines from 6 exporter modules and the "Superset of…" note in a365/constants.py, replacing them with customer-centered summaries.

Malformed docstrings

  • Reformatted the crammed reST :param:/:return: block in populate_invoke_agent_scope.py to Google style.
  • Fixed an Unexpected indentation docutils error from indented URLs in models/messages.py.

All changes are docstring/comment-only except adding a doc comment to the existing A365_PARENT_TRACEPARENT_KEY constant.

Copilot AI changed the title [WIP] Fix broken links and improve documentation Documentation improvements for published API reference Jun 19, 2026
Copilot AI requested a review from nikhilNava June 19, 2026 22:43
@nikhilNava nikhilNava marked this pull request as ready for review June 22, 2026 20:40
Copilot AI review requested due to automatic review settings June 22, 2026 20:40

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 improves the docstrings and inline documentation that drive the published API reference for microsoft-opentelemetry, primarily to fix broken cross-references and to provide missing module/enum/constant descriptions for the Agent365 (a365) surface area.

Changes:

  • Fully-qualifies Sphinx reST cross-reference targets (:func:, :meth:, :class:, :data:) to avoid “Cross reference not found” in docfx output.
  • Adds/updates module docstrings and enum/constant member documentation so key symbols render with helpful descriptions.
  • Reformats docstrings to avoid docutils formatting errors (e.g., indentation issues, cramped param blocks).

Reviewed changes

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

Show a summary per file
File Description
src/microsoft/opentelemetry/a365/runtime/init.py Adds package docstring describing runtime helpers.
src/microsoft/opentelemetry/a365/langchain/init.py Adds package docstring describing LangChain integration behavior.
src/microsoft/opentelemetry/a365/hosting/scope_helpers/populate_invoke_agent_scope.py Reformats function docstring to Google-style sections.
src/microsoft/opentelemetry/a365/hosting/middleware/output_logging_middleware.py Documents A365_PARENT_TRACEPARENT_KEY and fully-qualifies doc cross-references.
src/microsoft/opentelemetry/a365/core/utils.py Fully-qualifies :meth: reference in get_traceparent docstring.
src/microsoft/opentelemetry/a365/core/tool_type.py Adds per-member enum documentation comments.
src/microsoft/opentelemetry/a365/core/models/messages.py Fixes module-docstring URL formatting; adds enum member docs.
src/microsoft/opentelemetry/a365/core/inference_operation_type.py Adds per-member enum documentation comments.
src/microsoft/opentelemetry/a365/core/guardrail_target_type.py Adds per-member constant documentation comments.
src/microsoft/opentelemetry/a365/core/guardrail_risk_severity.py Adds per-member constant documentation comments.
src/microsoft/opentelemetry/a365/core/guardrail_decision_type.py Adds per-member constant documentation comments.
src/microsoft/opentelemetry/a365/core/exporters/utils.py Replaces internal “vendored from …” note with customer-facing summary.
src/microsoft/opentelemetry/a365/core/exporters/span_processor.py Removes internal vendoring note from docstring.
src/microsoft/opentelemetry/a365/core/exporters/enriching_span_processor.py Replaces internal “vendored from …” note with customer-facing summary.
src/microsoft/opentelemetry/a365/core/exporters/enriched_span.py Replaces internal “vendored from …” note with customer-facing summary.
src/microsoft/opentelemetry/a365/core/exporters/agent365_exporter.py Replaces internal “vendored from …” note with customer-facing summary.
src/microsoft/opentelemetry/a365/core/exporters/agent365_exporter_options.py Rewrites module docstring to describe exported configuration options.
src/microsoft/opentelemetry/a365/core/constants.py Converts header comment into a module docstring describing constant purpose.
src/microsoft/opentelemetry/a365/core/init.py Adds module docstring summarizing the core primitives and surface area.
src/microsoft/opentelemetry/a365/constants.py Replaces internal “superset of …” note with customer-facing summary.
src/microsoft/opentelemetry/init.py Fully-qualifies use_microsoft_opentelemetry doc reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nikhilNava nikhilNava merged commit e58ae27 into main Jun 22, 2026
12 checks passed
@nikhilNava nikhilNava deleted the copilot/fix-documentation-improvements branch June 22, 2026 23:53
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.

4 participants