Skip to content

Commit

Permalink
Fix broken tests in httpx 0.23.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipuniverse committed Apr 12, 2023
1 parent a7a4f71 commit abc8e7f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

- `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))
- Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748))

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [

[project.optional-dependencies]
instruments = [
"httpx >= 0.18.0, <= 0.23.0",
"httpx >= 0.18.0",
]
test = [
"opentelemetry-instrumentation-httpx[instruments]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _async_call(coro: typing.Coroutine) -> asyncio.Task:
def _response_hook(span, request: "RequestInfo", response: "ResponseInfo"):
span.set_attribute(
HTTP_RESPONSE_BODY,
response[2].read(),
b"".join([part for part in response[2]]),
)


Expand All @@ -68,7 +68,7 @@ async def _async_response_hook(
):
span.set_attribute(
HTTP_RESPONSE_BODY,
await response[2].aread(),
b"".join([part async for part in response[2]]),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"instrumentation": "opentelemetry-instrumentation-grpc==0.39b0.dev",
},
"httpx": {
"library": "httpx >= 0.18.0, <= 0.23.0",
"library": "httpx >= 0.18.0",
"instrumentation": "opentelemetry-instrumentation-httpx==0.39b0.dev",
},
"jinja2": {
Expand Down

0 comments on commit abc8e7f

Please sign in to comment.