Skip to content

Document FastAPI instrumentation setup#4555

Open
Harshal96 wants to merge 5 commits into
open-telemetry:mainfrom
Harshal96:doc-fastapi-doc-holes
Open

Document FastAPI instrumentation setup#4555
Harshal96 wants to merge 5 commits into
open-telemetry:mainfrom
Harshal96:doc-fastapi-doc-holes

Conversation

@Harshal96
Copy link
Copy Markdown

Description

Clarifies the FastAPI instrumentation docs for auto-instrumentation environment configuration, trace propagation, WebSocket behavior, and log export. Also renders the opentelemetry-instrumentation README in the generated docs so the opentelemetry-instrument package has a clearer docs menu entry.

Fixes #3301

Type of change

  • This change requires a documentation update

How Has This Been Tested?

  • python3 -m py_compile instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py
  • uv run --no-project --with docutils --with pygments python3 -c "...FastAPI docstring RST parsed..."
  • uv run --no-project --with docutils python3 -c "...opentelemetry-instrumentation README RST parsed..."
  • uv run --no-project --with ruff ruff check instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py
  • git diff --check

Full docs build was attempted with uv run sphinx-build -W --keep-going -b html docs docs/_build/html, but this local machine could not complete the workspace sync because the unrelated mysqlclient==2.2.8 build requires pkg-config/MySQL client build flags.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

Clarify FastAPI auto-instrumentation configuration, propagation, WebSocket behavior, and log export. Also surface the opentelemetry-instrumentation README in the generated docs menu.

Assisted-by: OpenAI Codex
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 8, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@Harshal96 Harshal96 marked this pull request as ready for review May 8, 2026 10:16
@Harshal96 Harshal96 requested a review from a team as a code owner May 8, 2026 10:16
@tammy-baylis-swi
Copy link
Copy Markdown
Contributor

Thank you @Harshal96 !

Please could you update this reference as per tox -e docs ci/cd:

sphinx.errors.SphinxWarning: /home/runner/work/opentelemetry-python-contrib/opentelemetry-python-contrib/opentelemetry-instrumentation/README.rst:27:'any' reference target not found: opentelemetry_distro

Also could you please add a changelog entry, since it's more than a few lines.

@tammy-baylis-swi tammy-baylis-swi moved this to Reviewed PRs that need fixes in Python PR digest May 8, 2026
@emdneto
Copy link
Copy Markdown
Member

emdneto commented May 12, 2026

Thanks for the PR!

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

Assisted-by: OpenAI Codex
@Harshal96
Copy link
Copy Markdown
Author

Done!

Comment thread docs/instrumentation/base/instrumentation.rst
Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Reviewed PRs that need fixes

Development

Successfully merging this pull request may close these issues.

Doc holes in FastAPI instrumentation

3 participants