Skip to content

Commit 0f46d55

Browse files
authored
Release v2.9.0 (#706)
1 parent 5349ca7 commit 0f46d55

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Release Notes
22

3+
## [v2.9.0] (2024-12-20)
4+
5+
* Capture httpx response JSON bodies by @alexmojaki in [#700](https://github.com/pydantic/logfire/pull/700)
6+
* Use end-at-shutdown and custom `record_exception` logic for all spans by @dmontagu in [#696](https://github.com/pydantic/logfire/pull/696)
7+
38
## [v2.8.0] (2024-12-18)
49

510
* Add `capture_(request|response)_headers` ([#671](https://github.com/pydantic/logfire/pull/671)) and `capture_request_json_body` ([#682](https://github.com/pydantic/logfire/pull/682)) to `instrument_httpx` by @Kludex
@@ -480,3 +485,4 @@ First release from new repo!
480485
[v2.7.0]: https://github.com/pydantic/logfire/compare/v2.6.2...v2.7.0
481486
[v2.7.1]: https://github.com/pydantic/logfire/compare/v2.7.0...v2.7.1
482487
[v2.8.0]: https://github.com/pydantic/logfire/compare/v2.7.1...v2.8.0
488+
[v2.9.0]: https://github.com/pydantic/logfire/compare/v2.8.0...v2.9.0

logfire-api/logfire_api/_internal/integrations/httpx.pyi

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import httpx
22
from logfire import Logfire as Logfire
33
from logfire._internal.main import set_user_attributes_on_raw_span as set_user_attributes_on_raw_span
44
from logfire._internal.utils import handle_internal_errors as handle_internal_errors
5+
from logfire.propagate import attach_context as attach_context, get_context as get_context
56
from opentelemetry.instrumentation.httpx import AsyncRequestHook, AsyncResponseHook, RequestHook, RequestInfo, ResponseHook, ResponseInfo
67
from opentelemetry.trace import Span
78
from typing import Any, Callable, Literal, ParamSpec, TypeVar, TypedDict, Unpack, overload
@@ -29,15 +30,16 @@ AsyncHook = TypeVar('AsyncHook', AsyncRequestHook, AsyncResponseHook)
2930
P = ParamSpec('P')
3031

3132
@overload
32-
def instrument_httpx(logfire_instance: Logfire, client: httpx.Client, capture_request_headers: bool, capture_response_headers: bool, capture_request_json_body: bool, **kwargs: Unpack[ClientKwargs]) -> None: ...
33+
def instrument_httpx(logfire_instance: Logfire, client: httpx.Client, capture_request_headers: bool, capture_response_headers: bool, capture_request_json_body: bool, capture_response_json_body: bool, **kwargs: Unpack[ClientKwargs]) -> None: ...
3334
@overload
34-
def instrument_httpx(logfire_instance: Logfire, client: httpx.AsyncClient, capture_request_headers: bool, capture_response_headers: bool, capture_request_json_body: bool, **kwargs: Unpack[AsyncClientKwargs]) -> None: ...
35+
def instrument_httpx(logfire_instance: Logfire, client: httpx.AsyncClient, capture_request_headers: bool, capture_response_headers: bool, capture_request_json_body: bool, capture_response_json_body: bool, **kwargs: Unpack[AsyncClientKwargs]) -> None: ...
3536
@overload
36-
def instrument_httpx(logfire_instance: Logfire, client: None, capture_request_headers: bool, capture_response_headers: bool, capture_request_json_body: bool, **kwargs: Unpack[HTTPXInstrumentKwargs]) -> None: ...
37+
def instrument_httpx(logfire_instance: Logfire, client: None, capture_request_headers: bool, capture_response_headers: bool, capture_request_json_body: bool, capture_response_json_body: bool, **kwargs: Unpack[HTTPXInstrumentKwargs]) -> None: ...
3738
def make_request_hook(hook: RequestHook | None, should_capture_headers: bool, should_capture_json: bool) -> RequestHook | None: ...
3839
def make_async_request_hook(hook: AsyncRequestHook | RequestHook | None, should_capture_headers: bool, should_capture_json: bool) -> AsyncRequestHook | None: ...
39-
def make_response_hook(hook: ResponseHook | None, should_capture_headers: bool) -> ResponseHook | None: ...
40-
def make_async_response_hook(hook: ResponseHook | AsyncResponseHook | None, should_capture_headers: bool) -> AsyncResponseHook | None: ...
40+
def make_response_hook(hook: ResponseHook | None, should_capture_headers: bool, should_capture_json: bool, logfire_instance: Logfire) -> ResponseHook | None: ...
41+
def make_async_response_hook(hook: ResponseHook | AsyncResponseHook | None, should_capture_headers: bool, should_capture_json: bool, logfire_instance: Logfire) -> AsyncResponseHook | None: ...
42+
def capture_response_json(logfire_instance: Logfire, response_info: ResponseInfo, is_async: bool) -> None: ...
4143
async def run_async_hook(hook: Callable[P, Any] | None, *args: P.args, **kwargs: P.kwargs) -> None: ...
4244
def run_hook(hook: Callable[P, Any] | None, *args: P.args, **kwargs: P.kwargs) -> None: ...
4345
def capture_response_headers(span: Span, response: ResponseInfo) -> None: ...

logfire-api/logfire_api/_internal/main.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,11 @@ class Logfire:
551551
def instrument_asyncpg(self, **kwargs: Unpack[AsyncPGInstrumentKwargs]) -> None:
552552
"""Instrument the `asyncpg` module so that spans are automatically created for each query."""
553553
@overload
554-
def instrument_httpx(self, client: httpx.Client, capture_request_headers: bool = False, capture_response_headers: bool = False, capture_request_json_body: bool = False, **kwargs: Unpack[ClientKwargs]) -> None: ...
554+
def instrument_httpx(self, client: httpx.Client, capture_request_headers: bool = False, capture_response_headers: bool = False, capture_request_json_body: bool = False, capture_response_json_body: bool = False, **kwargs: Unpack[ClientKwargs]) -> None: ...
555555
@overload
556-
def instrument_httpx(self, client: httpx.AsyncClient, capture_request_headers: bool = False, capture_response_headers: bool = False, capture_request_json_body: bool = False, **kwargs: Unpack[AsyncClientKwargs]) -> None: ...
556+
def instrument_httpx(self, client: httpx.AsyncClient, capture_request_headers: bool = False, capture_response_headers: bool = False, capture_request_json_body: bool = False, capture_response_json_body: bool = False, **kwargs: Unpack[AsyncClientKwargs]) -> None: ...
557557
@overload
558-
def instrument_httpx(self, client: None = None, capture_request_headers: bool = False, capture_response_headers: bool = False, capture_request_json_body: bool = False, **kwargs: Unpack[HTTPXInstrumentKwargs]) -> None: ...
558+
def instrument_httpx(self, client: None = None, capture_request_headers: bool = False, capture_response_headers: bool = False, capture_request_json_body: bool = False, capture_response_json_body: bool = False, **kwargs: Unpack[HTTPXInstrumentKwargs]) -> None: ...
559559
def instrument_celery(self, **kwargs: Any) -> None:
560560
"""Instrument `celery` so that spans are automatically created for each task.
561561

logfire-api/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "logfire-api"
7-
version = "2.8.0"
7+
version = "2.9.0"
88
description = "Shim for the Logfire SDK which does nothing unless Logfire is installed"
99
authors = [
1010
{ name = "Pydantic Team", email = "[email protected]" },

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "logfire"
7-
version = "2.8.0"
7+
version = "2.9.0"
88
description = "The best Python observability tool! 🪵🔥"
99
requires-python = ">=3.8"
1010
authors = [

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)