diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e10161b..50f61c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release Notes +## [v2.10.0] (2024-12-23) + +* Add `capture_request_form_data` param to `instrument_httpx` by @alexmojaki in [#711](https://github.com/pydantic/logfire/pull/711) +* Replace `capture_(request|response)_headers` with just `capture_headers` in `instrument_httpx` by @Kludex in [#719](https://github.com/pydantic/logfire/pull/719) +* Support SQLAlchemy `AsyncEngine` by @Kludex in [#717](https://github.com/pydantic/logfire/pull/717) + ## [v2.9.0] (2024-12-20) * Capture httpx response JSON bodies by @alexmojaki in [#700](https://github.com/pydantic/logfire/pull/700) @@ -486,3 +492,4 @@ First release from new repo! [v2.7.1]: https://github.com/pydantic/logfire/compare/v2.7.0...v2.7.1 [v2.8.0]: https://github.com/pydantic/logfire/compare/v2.7.1...v2.8.0 [v2.9.0]: https://github.com/pydantic/logfire/compare/v2.8.0...v2.9.0 +[v2.10.0]: https://github.com/pydantic/logfire/compare/v2.9.0...v2.10.0 diff --git a/logfire-api/logfire_api/_internal/integrations/httpx.pyi b/logfire-api/logfire_api/_internal/integrations/httpx.pyi index 745425c7..23bd1078 100644 --- a/logfire-api/logfire_api/_internal/integrations/httpx.pyi +++ b/logfire-api/logfire_api/_internal/integrations/httpx.pyi @@ -1,7 +1,9 @@ import httpx from _typeshed import Incomplete +from email.headerregistry import ContentTypeHeader from logfire import Logfire as Logfire from logfire._internal.main import set_user_attributes_on_raw_span as set_user_attributes_on_raw_span +from logfire._internal.stack_info import warn_at_user_stacklevel as warn_at_user_stacklevel from logfire._internal.utils import handle_internal_errors as handle_internal_errors from logfire.integrations.httpx import AsyncRequestHook as AsyncRequestHook, AsyncResponseHook as AsyncResponseHook, RequestHook as RequestHook, RequestInfo as RequestInfo, ResponseHook as ResponseHook, ResponseInfo as ResponseInfo from logfire.propagate import attach_context as attach_context, get_context as get_context @@ -46,10 +48,16 @@ def run_hook(hook: Callable[P, Any] | None, *args: P.args, **kwargs: P.kwargs) - def capture_response_headers(span: Span, response: ResponseInfo) -> None: ... def capture_request_headers(span: Span, request: RequestInfo) -> None: ... def capture_headers(span: Span, headers: httpx.Headers, request_or_response: Literal['request', 'response']) -> None: ... -def get_charset(content_type: str) -> str: ... -def decode_body(body: bytes, content_type: str): ... +def decode_body(body: bytes, charset: str): ... def capture_request_body(span: Span, request: RequestInfo) -> None: ... CODES_FOR_METHODS_WITH_DATA_PARAM: Incomplete def capture_request_form_data(span: Span, request: RequestInfo) -> None: ... +def content_type_header_from_string(content_type: str) -> ContentTypeHeader: ... +def content_type_subtypes(subtype: str) -> set[str]: ... +def is_json_type(content_type: str) -> bool: ... + +TEXT_SUBTYPES: Incomplete + +def is_text_type(content_type: str) -> bool: ... diff --git a/logfire-api/pyproject.toml b/logfire-api/pyproject.toml index 66f1b987..e16223ef 100644 --- a/logfire-api/pyproject.toml +++ b/logfire-api/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "logfire-api" -version = "2.9.0" +version = "2.10.0" description = "Shim for the Logfire SDK which does nothing unless Logfire is installed" authors = [ { name = "Pydantic Team", email = "engineering@pydantic.dev" }, diff --git a/pyproject.toml b/pyproject.toml index eaa809a3..e4cdfaf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "logfire" -version = "2.9.0" +version = "2.10.0" description = "The best Python observability tool! 🪵🔥" requires-python = ">=3.8" authors = [ diff --git a/uv.lock b/uv.lock index 670291e9..471414d1 100644 --- a/uv.lock +++ b/uv.lock @@ -1398,7 +1398,7 @@ wheels = [ [[package]] name = "logfire" -version = "2.9.0" +version = "2.10.0" source = { editable = "." } dependencies = [ { name = "executing" }, @@ -1675,7 +1675,7 @@ docs = [ [[package]] name = "logfire-api" -version = "2.9.0" +version = "2.10.0" source = { editable = "logfire-api" } [package.metadata]