Skip to content

Commit abc8e7f

Browse files
Fix broken tests in httpx 0.23.1+
Fixes #1463
1 parent a7a4f71 commit abc8e7f

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## Unreleased
99

1010
- `opentelemetry-instrumentation-system-metrics` Add `process.` prefix to `runtime.memory`, `runtime.cpu.time`, and `runtime.gc_count`. Change `runtime.memory` from count to UpDownCounter. ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735))
11+
- Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748))
1112

1213
### Added
1314

instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232

3333
[project.optional-dependencies]
3434
instruments = [
35-
"httpx >= 0.18.0, <= 0.23.0",
35+
"httpx >= 0.18.0",
3636
]
3737
test = [
3838
"opentelemetry-instrumentation-httpx[instruments]",

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _async_call(coro: typing.Coroutine) -> asyncio.Task:
5959
def _response_hook(span, request: "RequestInfo", response: "ResponseInfo"):
6060
span.set_attribute(
6161
HTTP_RESPONSE_BODY,
62-
response[2].read(),
62+
b"".join([part for part in response[2]]),
6363
)
6464

6565

@@ -68,7 +68,7 @@ async def _async_response_hook(
6868
):
6969
span.set_attribute(
7070
HTTP_RESPONSE_BODY,
71-
await response[2].aread(),
71+
b"".join([part async for part in response[2]]),
7272
)
7373

7474

opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"instrumentation": "opentelemetry-instrumentation-grpc==0.39b0.dev",
8282
},
8383
"httpx": {
84-
"library": "httpx >= 0.18.0, <= 0.23.0",
84+
"library": "httpx >= 0.18.0",
8585
"instrumentation": "opentelemetry-instrumentation-httpx==0.39b0.dev",
8686
},
8787
"jinja2": {

0 commit comments

Comments
 (0)