Skip to content

feat: add scoped HTTPX instrumentation - #192

Draft
parvahuja wants to merge 1 commit into
parv/httpx-client-adapters-v0.14from
parv/httpx-instrumentation-v0.15
Draft

feat: add scoped HTTPX instrumentation#192
parvahuja wants to merge 1 commit into
parv/httpx-client-adapters-v0.14from
parv/httpx-instrumentation-v0.15

Conversation

@parvahuja

@parvahuja parvahuja commented Jul 28, 2026

Copy link
Copy Markdown
Member

Stack 7 of 8 · depends on #191 · next: #193

Summary

Add scoped global HTTPX instrumentation so Python harnesses can make existing HTTPX clients payment-aware without replacing their transports.

  • context scope is local and restores cleanly
  • process scope propagates to worker threads
  • nested bindings and recursive payment-internal HTTP are suppressed safely
  • ambiguous process runtimes fail closed
  • thread primitives are patched only while process scope is active

Scope

HTTPX only. This does not instrument MCP globally.

Validation

  • 929 passed, 41 skipped
  • 36 combined adapter/instrumentation cases pass on every supported HTTPX version
  • factory entry, standalone events, credential work, and teardown remain outside recursive instrumentation
  • Ruff, formatting, Pyright, diff checks, and Python 3.11–3.14 CI pass

Managed as a stacked change with GitHub Stacks.

@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from a59c50b to 89283ac Compare July 28, 2026 18:26
@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from 89283ac to e2ff779 Compare July 28, 2026 23:29
@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from e2ff779 to d6fe846 Compare July 29, 2026 00:44
@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from d6fe846 to 8767e4f Compare July 29, 2026 01:02
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.

1 participant