Skip to content

Commit 7021232

Browse files
authored
Release v2.4.1 (#617)
1 parent b83c786 commit 7021232

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

CHANGELOG.md

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

3+
## [v2.4.1] (2024-11-21)
4+
5+
* Allow new context argument of metric instrument methods to be passed positionally by @alexmojaki in [#616](https://github.com/pydantic/logfire/pull/616)
6+
37
## [v2.4.0] (2024-11-20)
48

59
* Support `logfire.instrument` without arguments by @Kludex in [#607](https://github.com/pydantic/logfire/pull/607)
@@ -434,3 +438,4 @@ First release from new repo!
434438
[v2.2.1]: https://github.com/pydantic/logfire/compare/v2.2.0...v2.2.1
435439
[v2.3.0]: https://github.com/pydantic/logfire/compare/v2.2.1...v2.3.0
436440
[v2.4.0]: https://github.com/pydantic/logfire/compare/v2.3.0...v2.4.0
441+
[v2.4.1]: https://github.com/pydantic/logfire/compare/v2.4.0...v2.4.1

logfire-api/logfire_api/_internal/metrics.pyi

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import dataclasses
22
from _typeshed import Incomplete
33
from abc import ABC
4-
from opentelemetry.context import Context
54
from opentelemetry.metrics import CallbackT as CallbackT, Counter, Histogram, Instrument, Meter, MeterProvider, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter, _Gauge
65
from opentelemetry.util.types import Attributes
76
from threading import Lock
8-
from typing import Any, Generic, Sequence, TypeVar, TypedDict
9-
from typing_extensions import Unpack
7+
from typing import Any, Generic, Sequence, TypeVar
108
from weakref import WeakSet
119

1210
Gauge: Incomplete
@@ -38,15 +36,6 @@ class _ProxyMeter(Meter):
3836
def create_observable_up_down_counter(self, name: str, callbacks: Sequence[CallbackT] | None = None, unit: str = '', description: str = '') -> ObservableUpDownCounter: ...
3937
InstrumentT = TypeVar('InstrumentT', bound=Instrument)
4038

41-
class MaybeContext(TypedDict, total=False):
42-
"""Backward-compatible keyword arguments for methods like `Counter.add`.
43-
44-
Starting with opentelemetry-sdk 1.28.0, these methods accept an additional optional `context` argument.
45-
This is passed to the underlying instrument using `**kwargs` for compatibility with older versions.
46-
This is the type hint for those kwargs.
47-
"""
48-
context: Context | None
49-
5039
class _ProxyInstrument(ABC, Generic[InstrumentT]):
5140
def __init__(self, instrument: InstrumentT, name: str, unit: str, description: str) -> None: ...
5241
def on_meter_set(self, meter: Meter) -> None:
@@ -56,17 +45,17 @@ class _ProxyAsynchronousInstrument(_ProxyInstrument[InstrumentT], ABC):
5645
def __init__(self, instrument: InstrumentT, name: str, callbacks: Sequence[CallbackT] | None, unit: str, description: str) -> None: ...
5746

5847
class _ProxyCounter(_ProxyInstrument[Counter], Counter):
59-
def add(self, amount: int | float, attributes: Attributes | None = None, **kwargs: Unpack[MaybeContext]) -> None: ...
48+
def add(self, amount: int | float, attributes: Attributes | None = None, *args: Any, **kwargs: Any) -> None: ...
6049

6150
class _ProxyHistogram(_ProxyInstrument[Histogram], Histogram):
62-
def record(self, amount: int | float, attributes: Attributes | None = None, **kwargs: Unpack[MaybeContext]) -> None: ...
51+
def record(self, amount: int | float, attributes: Attributes | None = None, *args: Any, **kwargs: Any) -> None: ...
6352

6453
class _ProxyObservableCounter(_ProxyAsynchronousInstrument[ObservableCounter], ObservableCounter): ...
6554
class _ProxyObservableGauge(_ProxyAsynchronousInstrument[ObservableGauge], ObservableGauge): ...
6655
class _ProxyObservableUpDownCounter(_ProxyAsynchronousInstrument[ObservableUpDownCounter], ObservableUpDownCounter): ...
6756

6857
class _ProxyUpDownCounter(_ProxyInstrument[UpDownCounter], UpDownCounter):
69-
def add(self, amount: int | float, attributes: Attributes | None = None, **kwargs: Unpack[MaybeContext]) -> None: ...
58+
def add(self, amount: int | float, attributes: Attributes | None = None, *args: Any, **kwargs: Any) -> None: ...
7059

7160
class _ProxyGauge(_ProxyInstrument[Gauge], Gauge):
72-
def set(self, amount: int | float, attributes: Attributes | None = None, **kwargs: Unpack[MaybeContext]) -> None: ...
61+
def set(self, amount: int | float, attributes: Attributes | None = None, *args: Any, **kwargs: Any) -> None: ...

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.4.0"
7+
version = "2.4.1"
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.4.0"
7+
version = "2.4.1"
88
description = "The best Python observability tool! 🪵🔥"
99
requires-python = ">=3.8"
1010
authors = [

uv.lock

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

0 commit comments

Comments
 (0)