Skip to content

Commit a5ed4da

Browse files
Relax httpx version to allow >= 0.18.0 (#1748)
1 parent 37d85f0 commit a5ed4da

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748))
11+
1012
## Version 1.18.0/0.39b0 (2023-05-10)
1113

1214
- `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))

instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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(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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"instrumentation": "opentelemetry-instrumentation-grpc==0.40b0.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.40b0.dev",
8686
},
8787
"jinja2": {

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ deps =
277277
httpx18: httpx>=0.18.0,<0.19.0
278278
httpx18: respx~=0.17.0
279279
httpx21: httpx>=0.19.0
280-
httpx21: respx~=0.19.0
280+
httpx21: respx~=0.20.1
281281

282282
; FIXME: add coverage testing
283283
; FIXME: add mypy testing

0 commit comments

Comments
 (0)