Skip to content

Commit 86542be

Browse files
authored
Release v3.14.0 (#999)
1 parent 1413f43 commit 86542be

File tree

6 files changed

+39
-5
lines changed

6 files changed

+39
-5
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+
## [v3.14.0] (2025-04-11)
4+
5+
* Experimental functions for recording feedback annotations
6+
37
## [v3.13.1] (2025-04-10)
48

59
* Upgrade to OpenTelemetry SDK 1.32.0 by @alexmojaki in [#991](https://github.com/pydantic/logfire/pull/991)
@@ -668,3 +672,4 @@ First release from new repo!
668672
[v3.12.0]: https://github.com/pydantic/logfire/compare/v3.11.0...v3.12.0
669673
[v3.13.0]: https://github.com/pydantic/logfire/compare/v3.12.0...v3.13.0
670674
[v3.13.1]: https://github.com/pydantic/logfire/compare/v3.13.0...v3.13.1
675+
[v3.14.0]: https://github.com/pydantic/logfire/compare/v3.13.1...v3.14.0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import logfire
2+
from _typeshed import Incomplete
3+
from logfire._internal.constants import ATTRIBUTES_MESSAGE_KEY as ATTRIBUTES_MESSAGE_KEY, ATTRIBUTES_SPAN_TYPE_KEY as ATTRIBUTES_SPAN_TYPE_KEY, DISABLE_CONSOLE_KEY as DISABLE_CONSOLE_KEY
4+
from logfire.propagate import attach_context as attach_context
5+
from opentelemetry.trace import Span
6+
from typing import Any
7+
8+
TRACEPARENT_PROPAGATOR: Incomplete
9+
TRACEPARENT_NAME: str
10+
feedback_logfire: Incomplete
11+
12+
def get_traceparent(span: Span | logfire.LogfireSpan) -> str:
13+
"""Get a string representing the span context to use for annotating spans."""
14+
def raw_annotate_span(traceparent: str, span_name: str, message: str, attributes: dict[str, Any]) -> None:
15+
"""Create a span of kind 'annotation' as a child of the span with the given traceparent."""
16+
def record_feedback(traceparent: str, name: str, value: int | float | bool | str, comment: str | None = None, extra: dict[str, Any] | None = None) -> None:
17+
"""Attach feedback to a span.
18+
19+
This is a more structured version of `raw_annotate_span`
20+
with special attributes recognized by the Logfire UI.
21+
22+
Args:
23+
traceparent: The traceparent string.
24+
name: The name of the evaluation.
25+
value: The value of the evaluation.
26+
Numbers are interpreted as scores, strings as labels, and booleans as assertions.
27+
comment: An optional reason for the evaluation.
28+
extra: Optional additional attributes to include in the span.
29+
"""

logfire-api/logfire_api/propagate.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get_context() -> ContextCarrier:
3737
...
3838
```
3939
"""
40-
def attach_context(carrier: ContextCarrier, *, third_party: bool = False) -> Iterator[None]:
40+
def attach_context(carrier: ContextCarrier, *, third_party: bool = False, propagator: TextMapPropagator | None = None) -> Iterator[None]:
4141
"""Attach a context as generated by [`get_context`][logfire.propagate.get_context] to the current execution context.
4242
4343
Since `attach_context` is a context manager, it restores the previous context when exiting.

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.13.1"
7+
version = "3.14.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 = "3.13.1"
7+
version = "3.14.0"
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)