Skip to content

Commit

Permalink
httpx: rewrite patching to use wrapt instead of subclassing client (#…
Browse files Browse the repository at this point in the history
…2909)

httpx: rewrote patching to use wrapt instead of subclassing client

Porting of httpx instrumentation to patch async transport methods instead of substituting the client. That is because the current approach will instrument httpx by instantianting another client with a custom transport class and this will race with code already subclassing. This one uses wrapt to patch the default httpx transport classes.

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
  • Loading branch information
xrmx and emdneto authored Oct 29, 2024
1 parent 7cbe586 commit f6b68d0
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 130 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2871](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2871))
- `opentelemetry-instrumentation` Don't fail distro loading if instrumentor raises ImportError, instead skip them
([#2923](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2923))
- `opentelemetry-instrumentation-httpx` Rewrote instrumentation to use wrapt instead of subclassing
([#2909](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2909))

## Version 1.27.0/0.48b0 (2024-08-28)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies = [
"opentelemetry-instrumentation == 0.49b0.dev",
"opentelemetry-semantic-conventions == 0.49b0.dev",
"opentelemetry-util-http == 0.49b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

[project.optional-dependencies]
Expand Down
Loading

0 comments on commit f6b68d0

Please sign in to comment.