Skip to content

Add Sphinx docs for opentelemetry.sdk.util package#5186

Open
OmYarewar wants to merge 2 commits intoopen-telemetry:mainfrom
OmYarewar:fix/add-sdk-util-docs
Open

Add Sphinx docs for opentelemetry.sdk.util package#5186
OmYarewar wants to merge 2 commits intoopen-telemetry:mainfrom
OmYarewar:fix/add-sdk-util-docs

Conversation

@OmYarewar
Copy link
Copy Markdown

Description

Ran into this while looking through the SDK docs — the opentelemetry.sdk.util package has several public utilities (BoundedList, BoundedDict, ns_to_iso_str, get_dict_as_key) but none of them show up in the generated Sphinx documentation. Only the instrumentation submodule had a docs page, and it was sitting under the trace toctree which didn't feel right since it's actually part of sdk.util, not sdk.trace.

Changes:

  • Added docs/sdk/util.rst with an automodule directive for opentelemetry.sdk.util so BoundedList, BoundedDict, ns_to_iso_str, and get_dict_as_key all get documented
  • Moved the util.instrumentation toctree entry from trace.rst to util.rst where it actually belongs
  • Added util to the SDK docs index

Fixes #2573

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Verified RST structure matches the existing pattern used by metrics.rst, trace.rst, etc.
  • Confirmed util.rst follows the same automodule + toctree pattern as other SDK doc pages
  • Need to run tox -e docs locally to verify the generated HTML renders correctly (don't have the full tox setup right now)

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

The sdk.util package exposes BoundedList, BoundedDict, ns_to_iso_str,
and get_dict_as_key but none of them appeared in the generated Sphinx
docs. Only the instrumentation submodule had a page
(util.instrumentation.rst), and it was incorrectly nested under the
trace toctree.

- Add docs/sdk/util.rst with automodule directive for
  opentelemetry.sdk.util
- Move util.instrumentation toctree entry from trace.rst to util.rst
- Add util to the SDK docs index

Fixes open-telemetry#2573

Assisted-by: Claude Opus 4.6
Signed-off-by: Om Yarewar <omyarewar@gmail.com>
@OmYarewar OmYarewar requested a review from a team as a code owner May 7, 2026 17:56
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 7, 2026

CLA Missing ID CLA Not Signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Some documentation not built into sphinx docs

1 participant