Skip to content

Commit 5852269

Browse files
authored
Merge branch 'main' into semconv-stability-prep
2 parents ebb84f7 + d155540 commit 5852269

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Add support to database stability opt-in in `_semconv` utilities and add tests
1717
([#3111](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3111))
1818

19+
### Fixed
20+
21+
- `opentelemetry-instrumentation-httpx` Fix `RequestInfo`/`ResponseInfo` type hints
22+
([#3105](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3105))
23+
24+
1925
## Version 1.29.0/0.50b0 (2024-12-11)
2026

2127
### Added

docs/nitpick-exceptions.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ py-class=
2929
httpx.SyncByteStream
3030
httpx.AsyncByteStream
3131
httpx.Response
32+
httpx.URL
33+
httpx.Headers
3234
aiohttp.web_request.Request
3335
yarl.URL
3436
cimpl.Producer

instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ async def async_response_hook(span, request, response):
192192
---
193193
"""
194194

195+
from __future__ import annotations
196+
195197
import logging
196198
import typing
197199
from asyncio import iscoroutinefunction
@@ -249,8 +251,8 @@ async def async_response_hook(span, request, response):
249251

250252
class RequestInfo(typing.NamedTuple):
251253
method: bytes
252-
url: URL
253-
headers: typing.Optional[Headers]
254+
url: httpx.URL
255+
headers: httpx.Headers | None
254256
stream: typing.Optional[
255257
typing.Union[httpx.SyncByteStream, httpx.AsyncByteStream]
256258
]
@@ -259,7 +261,7 @@ class RequestInfo(typing.NamedTuple):
259261

260262
class ResponseInfo(typing.NamedTuple):
261263
status_code: int
262-
headers: typing.Optional[Headers]
264+
headers: httpx.Headers | None
263265
stream: typing.Iterable[bytes]
264266
extensions: typing.Optional[dict]
265267

0 commit comments

Comments
 (0)