Skip to content

Commit 67fb151

Browse files
xrmxemdneto
authored andcommitted
httpx: rewrite patching to use wrapt instead of subclassing client (open-telemetry#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 <[email protected]>
1 parent e7719b5 commit 67fb151

File tree

4 files changed

+350
-130
lines changed

4 files changed

+350
-130
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4141
([#2871](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2871))
4242
- `opentelemetry-instrumentation` Don't fail distro loading if instrumentor raises ImportError, instead skip them
4343
([#2923](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2923))
44+
- `opentelemetry-instrumentation-httpx` Rewrote instrumentation to use wrapt instead of subclassing
45+
([#2909](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2909))
4446

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

Diff for: instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dependencies = [
2929
"opentelemetry-instrumentation == 0.49b0.dev",
3030
"opentelemetry-semantic-conventions == 0.49b0.dev",
3131
"opentelemetry-util-http == 0.49b0.dev",
32+
"wrapt >= 1.0.0, < 2.0.0",
3233
]
3334

3435
[project.optional-dependencies]

0 commit comments

Comments
 (0)