Skip to content

Commit d1a6f4c

Browse files
authored
Release v3.18.0 (#1126)
1 parent b8c8148 commit d1a6f4c

31 files changed

+90
-43
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.18.0] (2025-06-05)
4+
5+
* Upgrade to OpenTelemetry SDK 1.34.0 by @alexmojaki in [#1120](https://github.com/pydantic/logfire/pull/1120)
6+
* Drop Python 3.8 support by @alexmojaki in [#1122](https://github.com/pydantic/logfire/pull/1122)
7+
38
## [v3.17.0] (2025-06-03)
49

510
* LangChain instrumentation via LangSmith by @alexmojaki in [#1084](https://github.com/pydantic/logfire/pull/1084)
@@ -721,3 +726,4 @@ First release from new repo!
721726
[v3.16.1]: https://github.com/pydantic/logfire/compare/v3.16.0...v3.16.1
722727
[v3.16.2]: https://github.com/pydantic/logfire/compare/v3.16.1...v3.16.2
723728
[v3.17.0]: https://github.com/pydantic/logfire/compare/v3.16.2...v3.17.0
729+
[v3.18.0]: https://github.com/pydantic/logfire/compare/v3.17.0...v3.18.0

logfire-api/logfire_api/_internal/async_.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ from .main import Logfire as Logfire
33
from .stack_info import StackInfo as StackInfo, get_code_object_info as get_code_object_info, get_stack_info_from_frame as get_stack_info_from_frame
44
from .utils import safe_repr as safe_repr
55
from _typeshed import Incomplete
6+
from contextlib import AbstractContextManager
67
from types import CoroutineType
7-
from typing import Any, ContextManager
8+
from typing import Any
89

910
ASYNCIO_PATH: Incomplete
1011

11-
def log_slow_callbacks(logfire: Logfire, slow_duration: float) -> ContextManager[None]:
12+
def log_slow_callbacks(logfire: Logfire, slow_duration: float) -> AbstractContextManager[None]:
1213
"""Log a warning whenever a function running in the asyncio event loop blocks for too long.
1314
1415
See Logfire.log_slow_async_callbacks.

logfire-api/logfire_api/_internal/auto_trace/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ from ..constants import ONE_SECOND_IN_NANOSECONDS as ONE_SECOND_IN_NANOSECONDS
22
from ..main import Logfire as Logfire
33
from .import_hook import LogfireFinder as LogfireFinder
44
from .types import AutoTraceModule as AutoTraceModule
5-
from typing import Callable, Literal, Sequence
5+
from collections.abc import Sequence
6+
from typing import Callable, Literal
67

78
def install_auto_tracing(logfire: Logfire, modules: Sequence[str] | Callable[[AutoTraceModule], bool], *, min_duration: float, check_imported_modules: Literal['error', 'warn', 'ignore'] = 'error') -> None:
89
"""Install automatic tracing.

logfire-api/logfire_api/_internal/auto_trace/import_hook.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ from ..main import Logfire as Logfire
22
from ..utils import log_internal_error as log_internal_error
33
from .rewrite_ast import compile_source as compile_source
44
from .types import AutoTraceModule as AutoTraceModule
5+
from collections.abc import Sequence
56
from dataclasses import dataclass
67
from importlib.abc import Loader, MetaPathFinder
78
from importlib.machinery import ModuleSpec
89
from types import ModuleType
9-
from typing import Any, Callable, Sequence
10+
from typing import Any, Callable
1011

1112
@dataclass
1213
class LogfireFinder(MetaPathFinder):

logfire-api/logfire_api/_internal/auto_trace/rewrite_ast.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import ast
22
from ..ast_utils import BaseTransformer as BaseTransformer, LogfireArgs as LogfireArgs
33
from ..main import Logfire as Logfire
4+
from contextlib import AbstractContextManager as AbstractContextManager
45
from dataclasses import dataclass
5-
from typing import Any, Callable, ContextManager, TypeVar
6+
from typing import Any, Callable, TypeVar
67

78
def compile_source(tree: ast.AST, filename: str, module_name: str, logfire_instance: Logfire, min_duration: int) -> Callable[[dict[str, Any]], None]:
89
"""Compile a modified AST of the module's source code in the module's namespace.
@@ -21,13 +22,13 @@ def compile_source(tree: ast.AST, filename: str, module_name: str, logfire_insta
2122
If `min_duration` is greater than 0, then `context_factories[index]` is initially `MeasureTime`.
2223
Otherwise, it's initially the `partial` above.
2324
"""
24-
def rewrite_ast(tree: ast.AST, filename: str, logfire_name: str, module_name: str, logfire_instance: Logfire, context_factories: list[Callable[[], ContextManager[Any]]], min_duration: int) -> ast.AST: ...
25+
def rewrite_ast(tree: ast.AST, filename: str, logfire_name: str, module_name: str, logfire_instance: Logfire, context_factories: list[Callable[[], AbstractContextManager[Any]]], min_duration: int) -> ast.AST: ...
2526

2627
@dataclass
2728
class AutoTraceTransformer(BaseTransformer):
2829
"""Trace all encountered functions except those explicitly marked with `@no_auto_trace`."""
2930
logfire_instance: Logfire
30-
context_factories: list[Callable[[], ContextManager[Any]]]
31+
context_factories: list[Callable[[], AbstractContextManager[Any]]]
3132
min_duration: int
3233
def check_no_auto_trace(self, node: ast.FunctionDef | ast.AsyncFunctionDef | ast.ClassDef) -> bool:
3334
"""Return true if the node has a `@no_auto_trace` or `@logfire.no_auto_trace` decorator."""

logfire-api/logfire_api/_internal/auto_trace/types.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import Sequence
12
from dataclasses import dataclass
2-
from typing import Sequence
33

44
@dataclass
55
class AutoTraceModule:

logfire-api/logfire_api/_internal/cli.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import argparse
2-
from typing import Any, Sequence
2+
from collections.abc import Sequence
3+
from typing import Any
34

45
__all__ = ['main', 'logfire_info']
56

logfire-api/logfire_api/_internal/config.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ from .stack_info import warn_at_user_stacklevel as warn_at_user_stacklevel
2121
from .tracer import OPEN_SPANS as OPEN_SPANS, PendingSpanProcessor as PendingSpanProcessor, ProxyTracerProvider as ProxyTracerProvider
2222
from .utils import SeededRandomIdGenerator as SeededRandomIdGenerator, UnexpectedResponse as UnexpectedResponse, ensure_data_dir_exists as ensure_data_dir_exists, handle_internal_errors as handle_internal_errors, platform_is_emscripten as platform_is_emscripten, read_toml_file as read_toml_file, suppress_instrumentation as suppress_instrumentation
2323
from _typeshed import Incomplete
24+
from collections.abc import Sequence
2425
from dataclasses import dataclass, field
2526
from logfire.exceptions import LogfireConfigError as LogfireConfigError
2627
from logfire.sampling import SamplingOptions as SamplingOptions
@@ -32,7 +33,7 @@ from opentelemetry.sdk.metrics.export import MetricReader as MetricReader
3233
from opentelemetry.sdk.trace import SpanProcessor
3334
from opentelemetry.sdk.trace.id_generator import IdGenerator
3435
from pathlib import Path
35-
from typing import Any, Callable, Literal, Sequence, TypedDict
36+
from typing import Any, Callable, Literal, TypedDict
3637
from typing_extensions import Self, Unpack
3738

3839
CREDENTIALS_FILENAME: str

logfire-api/logfire_api/_internal/db_statement_summary.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from _typeshed import Incomplete
2-
from typing import Any, Mapping
2+
from collections.abc import Mapping
3+
from typing import Any
34

45
MAX_QUERY_MESSAGE_LENGTH: int
56

logfire-api/logfire_api/_internal/exporters/console.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ from ..constants import ATTRIBUTES_JSON_SCHEMA_KEY as ATTRIBUTES_JSON_SCHEMA_KEY
22
from ..json_formatter import json_args_value_formatter as json_args_value_formatter
33
from ..utils import truncate_string as truncate_string
44
from _typeshed import Incomplete
5-
from collections.abc import Sequence
5+
from collections.abc import Mapping, Sequence
66
from dataclasses import dataclass
77
from opentelemetry.sdk._logs import LogData as LogData, LogRecord
88
from opentelemetry.sdk._logs.export import LogExportResult, LogExporter
99
from opentelemetry.sdk.trace import Event, ReadableSpan
1010
from opentelemetry.sdk.trace.export import SpanExportResult, SpanExporter
11-
from typing import Mapping, TextIO
11+
from typing import TextIO
1212

1313
ConsoleColorsValues: Incomplete
1414
TextParts = list[tuple[str, str]]

0 commit comments

Comments
 (0)