Skip to content

docs(requests): clarify hook mutation and propagation order - #4992

Open
jstar0 wants to merge 2 commits into
open-telemetry:mainfrom
jstar0:fix/4990-request-hook-docs
Open

docs(requests): clarify hook mutation and propagation order#4992
jstar0 wants to merge 2 commits into
open-telemetry:mainfrom
jstar0:fix/4990-request-hook-docs

Conversation

@jstar0

@jstar0 jstar0 commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Fixes #4990.

Clarify that request_hook receives the live requests.PreparedRequest, that mutations affect the outbound request, and that propagation injection runs afterward and may replace propagation headers. Add the same guidance to the package README and API documentation, including a small header-mutation example.

Testing

  • env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy tox -e py312-test-instrumentation-requests (80 passed)
  • Ruff check and format check for the changed Python module
  • Sphinx requests page build succeeded with optional database imports mocked; the full docs build is blocked on the host missing libmysqlclient.24.dylib while importing the unchanged MySQL instrumentation
  • git diff --check

Documentation-only change; no core repository change or changelog fragment is required.

Document that request hooks operate on the live PreparedRequest before propagation injection, and that mutations affect the outbound request.

Assisted-by: ChatGPT 5.2
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 25, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-08-29 12:26 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

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.

requests instrumentation: document request_hook mutation and propagation ordering

1 participant