Skip to content

Commit c346262

Browse files
authored
Release v3.16.1 (#1091)
1 parent a0866e2 commit c346262

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
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+
## [v3.16.1] (2025-05-26)
4+
5+
* Infer base URL from read token in query client by @Viicos in [#1088](https://github.com/pydantic/logfire/pull/1088)
6+
* Add `include_binary_content` ([#1090](https://github.com/pydantic/logfire/pull/1090)) and `**kwargs` ([#1078](https://github.com/pydantic/logfire/pull/1078)) to `instrument_pydantic_ai` by @alexmojaki
7+
38
## [v3.16.0] (2025-05-14)
49

510
* Make OpenAI spans show token usage in logfire UI by @alexmojaki in [#1076](https://github.com/pydantic/logfire/pull/1076)
@@ -700,3 +705,4 @@ First release from new repo!
700705
[v3.15.0]: https://github.com/pydantic/logfire/compare/v3.14.1...v3.15.0
701706
[v3.15.1]: https://github.com/pydantic/logfire/compare/v3.15.0...v3.15.1
702707
[v3.16.0]: https://github.com/pydantic/logfire/compare/v3.15.1...v3.16.0
708+
[v3.16.1]: https://github.com/pydantic/logfire/compare/v3.16.0...v3.16.1

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ from logfire import Logfire as Logfire
22
from pydantic_ai import Agent
33
from pydantic_ai.models import Model
44
from pydantic_ai.models.instrumented import InstrumentedModel
5-
from typing import Literal
5+
from typing import Any, Literal
66

7-
def instrument_pydantic_ai(logfire_instance: Logfire, obj: Agent | Model | None, event_mode: Literal['attributes', 'logs'] | None) -> None | InstrumentedModel: ...
7+
def instrument_pydantic_ai(logfire_instance: Logfire, obj: Agent | Model | None, event_mode: Literal['attributes', 'logs'] | None, **kwargs: Any) -> None | InstrumentedModel: ...

logfire-api/logfire_api/_internal/main.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ class Logfire:
422422
Exclude specific modules from instrumentation.
423423
"""
424424
@overload
425-
def instrument_pydantic_ai(self, obj: pydantic_ai.Agent | None = None, /, *, event_mode: Literal['attributes', 'logs'] = 'attributes') -> None: ...
425+
def instrument_pydantic_ai(self, obj: pydantic_ai.Agent | None = None, /, *, event_mode: Literal['attributes', 'logs'] = 'attributes', include_binary_content: bool | None = None, **kwargs: Any) -> None: ...
426426
@overload
427-
def instrument_pydantic_ai(self, obj: pydantic_ai.models.Model, /, *, event_mode: Literal['attributes', 'logs'] = 'attributes') -> pydantic_ai.models.Model: ...
427+
def instrument_pydantic_ai(self, obj: pydantic_ai.models.Model, /, *, event_mode: Literal['attributes', 'logs'] = 'attributes', include_binary_content: bool | None = None, **kwargs: Any) -> pydantic_ai.models.Model: ...
428428
def instrument_fastapi(self, app: FastAPI, *, capture_headers: bool = False, request_attributes_mapper: Callable[[Request | WebSocket, dict[str, Any]], dict[str, Any] | None] | None = None, excluded_urls: str | Iterable[str] | None = None, record_send_receive: bool = False, **opentelemetry_kwargs: Any) -> ContextManager[None]:
429429
"""Instrument a FastAPI app so that spans and logs are automatically created for each request.
430430

logfire-api/logfire_api/experimental/query_client.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ from _typeshed import Incomplete
22
from datetime import datetime
33
from httpx import AsyncClient, Client, Response, Timeout
44
from httpx._client import BaseClient
5+
from logfire._internal.config import get_base_url_from_token as get_base_url_from_token
56
from pyarrow import Table
67
from types import TracebackType
78
from typing import Any, Generic, TypeVar, TypedDict
9+
from typing_extensions import Self
810

911
DEFAULT_TIMEOUT: Incomplete
1012

@@ -32,8 +34,6 @@ class RowQueryResults(TypedDict):
3234
columns: list[ColumnDetails]
3335
rows: list[dict[str, Any]]
3436
T = TypeVar('T', bound=BaseClient)
35-
S = TypeVar('S', bound='LogfireQueryClient')
36-
R = TypeVar('R', bound='AsyncLogfireQueryClient')
3737

3838
class _BaseLogfireQueryClient(Generic[T]):
3939
base_url: Incomplete
@@ -46,8 +46,8 @@ class _BaseLogfireQueryClient(Generic[T]):
4646

4747
class LogfireQueryClient(_BaseLogfireQueryClient[Client]):
4848
"""A synchronous client for querying Logfire data."""
49-
def __init__(self, read_token: str, base_url: str = 'https://logfire-api.pydantic.dev/', timeout: Timeout = ..., **client_kwargs: Any) -> None: ...
50-
def __enter__(self) -> S: ...
49+
def __init__(self, read_token: str, base_url: str | None = None, timeout: Timeout = ..., **client_kwargs: Any) -> None: ...
50+
def __enter__(self) -> Self: ...
5151
def __exit__(self, exc_type: type[BaseException] | None = None, exc_value: BaseException | None = None, traceback: TracebackType | None = None) -> None: ...
5252
def query_json(self, sql: str, min_timestamp: datetime | None = None, max_timestamp: datetime | None = None, limit: int | None = None) -> QueryResults:
5353
"""Query Logfire data and return the results as a column-oriented dictionary."""
@@ -68,8 +68,8 @@ class LogfireQueryClient(_BaseLogfireQueryClient[Client]):
6868

6969
class AsyncLogfireQueryClient(_BaseLogfireQueryClient[AsyncClient]):
7070
"""An asynchronous client for querying Logfire data."""
71-
def __init__(self, read_token: str, base_url: str = 'https://logfire-api.pydantic.dev/', timeout: Timeout = ..., **async_client_kwargs: Any) -> None: ...
72-
async def __aenter__(self) -> R: ...
71+
def __init__(self, read_token: str, base_url: str | None = None, timeout: Timeout = ..., **async_client_kwargs: Any) -> None: ...
72+
async def __aenter__(self) -> Self: ...
7373
async def __aexit__(self, exc_type: type[BaseException] | None = None, exc_value: BaseException | None = None, traceback: TracebackType | None = None) -> None: ...
7474
async def query_json(self, sql: str, min_timestamp: datetime | None = None, max_timestamp: datetime | None = None, limit: int | None = None) -> QueryResults:
7575
"""Query Logfire data and return the results as a column-oriented dictionary."""

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 = "3.16.0"
7+
version = "3.16.1"
88
description = "Shim for the Logfire SDK which does nothing unless Logfire is installed"
99
authors = [
1010
{ name = "Pydantic Team", email = "engineering@pydantic.dev" },

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 = "3.16.0"
7+
version = "3.16.1"
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)