unstale

pypi / logfire

logfire

What changed in logfire 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

53 breaking5 security4 deprecations44 new APIs and options3 performance64 behavior and defaults10 tooling95 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

logfire 5142 changes

Breaking changes 34

  • Requires pydantic-monty-client>=1.6.0, which sends the first request without waiting for the Configure reply and raises typed connection and configuration errors.

    5.6.0release notes

  • Returns a plain pydantic_monty.AsyncMontyRemote instead of the AgentSandboxPool wrapper, allowing it to be passed to code typed against Monty.

    5.6.0release notes

  • Azure content filter chunks are skipped in OpenAI streams.

    5.6.0release notes

  • Levels above CRITICAL are mapped to fatal.

    5.6.0release notes

  • Structlog critical events are logged at the fatal level.

    5.6.0release notes

  • AWS security tokens are scrubbed by default.

    5.5.0release notes

  • Incoming context is dropped when distributed tracing is disabled.

    5.5.0release notes

  • Project credentials are required before SDK configuration.

    5.5.0release notes

  • SpanLevel compares equal to the string 'warning'.

    5.5.0release notes

  • Telemetry is sent with the API key when no write token is configured.

    5.5.0release notes

  • Dataclass types are logged using their repr instead of their default field values.

    5.4.0release notes

  • The console exporter formats an empty set as set().

    5.4.0release notes

  • The console exporter prints generator attributes using their repr.

    5.4.0release notes

  • OAuth-style access token values are scrubbed by default.

    5.3.0release notes

  • Bearer token values are scrubbed by default.

    5.3.0release notes

  • Formats range attributes in console output.

    5.3.0release notes

  • HMAC key values are scrubbed by default.

    5.3.0release notes

  • OAuth-style ID token values are scrubbed by default.

    5.3.0release notes

  • Automatically instruments Starlette apps when run with logfire run.

    5.3.0release notes

  • Suppresses native FastAPI telemetry.

    5.3.0release notes

  • Passphrase values are scrubbed by default.

    5.3.0release notes

  • Signing key values are scrubbed by default.

    5.3.0release notes

  • Raises an error when SQLAlchemy instrumentation is skipped.

    5.3.0release notes

  • Treats logfire.tags passed through structlog as log tags.

    5.3.0release notes

  • HTTP span messages use stable HTTP semantic convention attributes.

    5.2.0release notes

  • Integers below the int64 minimum are converted to strings when used as span attributes.

    5.2.0release notes

  • The deprecated Flask exclude_urls argument has been removed.

    5.0.0release notes

  • The Logfire token check is skipped inside AWS Lambda.

    5.0.0release notes

  • The deprecated CLI option --logfire-url has been removed.

    5.0.0release notes

  • Third-party Pydantic models are no longer instrumented by default.

    5.0.0release notes

  • The Pydantic integration's OTel instrumentation scope is now logfire.pydantic.

    5.0.0release notes

  • Managed variable pushes are strict by default.

    5.0.0release notes

  • Buffers are kept until every span in the trace has ended.

    5.0.0release notes

  • OpenAI and Anthropic instrumentation now defaults to version 2, changing the format of recorded attributes.

    5.0.0release notes

Security 3

New APIs and options 9

  • Agent sandboxes connect over gRPC with pydantic-monty 1.5.0.

    5.5.0release notes

  • configure(fleet=...) manages the SDK from Logfire Fleet.

    5.5.0release notes

  • Adds agent_sandboxes() to Logfire.

    5.4.0release notes

  • Records why a run ended in error.

    5.3.0release notes

  • Adds the pending_spans option.

    5.3.0release notes

  • Adds a compression option, with experimental zstd support.

    5.2.0release notes

  • Console attributes can be shown without enabling verbose output.

    5.2.0release notes

  • Adds instrumentation for Litestar 2.11 and later.

    5.1.0release notes

  • The Gateway CLI now supports the LOGFIRE_BASE_URL environment variable.

    5.0.0release notes

Performance 1

  • Scrubbing is faster for simple types through a fast path.

    5.6.0release notes

Behavior and default changes 38

  • instrument_sqlite3 and instrument_mysql now return the connection.

    5.6.0release notes

  • SpanLevel is hashed by name, and hashing it is discouraged with a warning.

    5.6.0release notes

  • Agent Sandboxes errors now include actionable hints.

    5.5.0release notes

  • The explanation of an Anthropic refusal is recorded as output text.

    5.5.0release notes

  • Content blocks sent back as input messages are converted.

    5.5.0release notes

  • configure() returns a Logfire instance when the SDK is not installed.

    5.5.0release notes

  • logfire run falls back to OpenTelemetry instrumentors.

    5.5.0release notes

  • Legacy function calls in input messages are recorded.

    5.5.0release notes

  • Audio responses and legacy function calls are recorded.

    5.5.0release notes

  • Custom tool calls from the OpenAI Responses API are recorded.

    5.5.0release notes

  • Variable overrides and targeting context are carried into thread pools.

    5.5.0release notes

  • Anthropic document and file-backed image input blocks are converted to semconv parts.

    5.4.0release notes

  • Custom tool calls from OpenAI chat completions are recorded.

    5.4.0release notes

  • Errors raised during LLM stream consumption are recorded.

    5.4.0release notes

  • OpenAI chat spans record max_completion_tokens as the requested maximum token count.

    5.4.0release notes

  • OpenAI cache write tokens are recorded on spans.

    5.4.0release notes

  • All pathlib.Path variants are serialized as plain strings.

    5.4.0release notes

  • Binary attributes are kept out of the secret scrubber.

    5.4.0release notes

  • Records cache token usage.

    5.3.0release notes

  • Records response IDs and finish reasons.

    5.3.0release notes

  • Formats bytearray attributes in console output.

    5.3.0release notes

  • Reads stable database semantic convention attributes when building messages.

    5.3.0release notes

  • Automatically instruments FastAPI apps when run with logfire run.

    5.3.0release notes

  • Automatically instruments Flask apps when run with logfire run.

    5.3.0release notes

  • Treats logfire.tags passed through logging as log tags.

    5.3.0release notes

  • Treats logfire.tags passed through loguru as log tags.

    5.3.0release notes

  • Records response IDs and finish reasons.

    5.3.0release notes

  • Records response IDs and finish reasons for streamed calls.

    5.3.0release notes

  • Records refusals in gen_ai.output.messages.

    5.3.0release notes

  • Records finish reasons for API calls.

    5.3.0release notes

  • Records streamed responses that end as incomplete or failed.

    5.3.0release notes

  • Records refusals as text in gen_ai.output.messages.

    5.3.0release notes

  • Records cached prompt tokens.

    5.3.0release notes

  • Includes the dataset in links when the report has one.

    5.3.0release notes

  • The CLI base URL defaults to the value of LOGFIRE_BASE_URL.

    5.2.0release notes

  • Query client errors expose RFC 9457 problem details.

    5.2.0release notes

  • Anthropic Bedrock calls are priced under the aws provider.

    5.0.0release notes

  • Logs produced with logfire.instrument_pydantic(record='failure') now record input_data.

    5.0.0release notes

Tooling 4

  • Isolates CLI diagnostic logging from application logging.

    5.3.0release notes

  • Excludes the working directory from sys.path while instrumenting packages.

    5.3.0release notes

  • Makes eval setup executable for Python and Node.js.

    5.1.0release notes

  • Recommends Logfire extras when missing instrumentation packages are detected.

    5.1.0release notes

Fixes and other changes 53

  • Formats non-string DataFrame indices in console output.

    5.6.0release notes

  • Logged DataFrames preserve integer precision.

    5.6.0release notes

  • Decoded JSON containers are scrubbed without a regex prefilter.

    5.6.0release notes

  • The JSON schema type for enums no longer depends on the order of the member set.

    5.6.0release notes

  • Preserves exceptions in instrumented async context managers.

    5.6.0release notes

  • Reports failures through handleError instead of raising them.

    5.6.0release notes

  • NumPy scalar attributes are recorded as numbers rather than their repr.

    5.6.0release notes

  • The current trace and span are reset when a generator is closed.

    5.6.0release notes

  • The shim shutdown now returns success.

    5.6.0release notes

  • The console exporter no longer crashes on attributes that format to an empty string.

    5.5.0release notes

  • Dictionary-valued case fields are serialized.

    5.5.0release notes

  • An invalid non-numeric value now identifies the setting in its error.

    5.5.0release notes

  • Duplicate console output from Loguru is avoided.

    5.5.0release notes

  • Empty items in comma-separated include/exclude settings are skipped.

    5.5.0release notes

  • Saving a read token works on Windows, where os.fchmod does not exist.

    5.5.0release notes

  • A span status set by the exception callback is preserved.

    5.5.0release notes

  • Streamed responses remain iterable when recording them fails.

    5.5.0release notes

  • Exceptions are recorded even when their __str__ method raises.

    5.4.0release notes

  • Non-string messages no longer break exporters.

    5.4.0release notes

  • SQL summaries count only top-level CTE names.

    5.4.0release notes

  • The duplicated tool call is removed from message content.

    5.4.0release notes

  • Unbalanced braces are treated as a formatting failure.

    5.4.0release notes

  • Preserves all tool result content parts.

    5.3.0release notes

  • Fixes DataFrame labels being cut off below pandas display limits.

    5.3.0release notes

  • Avoids sending empty schemas when pushing a dataset typed with Any.

    5.3.0release notes

  • Uses exception callback levels when setting span status.

    5.3.0release notes

  • Prevents CLI tracing from replacing the global provider.

    5.3.0release notes

  • Prevents routing errors from escaping span naming.

    5.3.0release notes

  • Handles zero-dimensional NumPy arrays in console formatting.

    5.3.0release notes

  • Records the response model for streamed calls.

    5.3.0release notes

  • Returns the provider response when recording it fails.

    5.3.0release notes

  • Keeps the parent context for spans started while instrumentation is suppressed.

    5.3.0release notes

  • Updates Anthropic instrumentation.

    5.2.0release notes

  • Logging respects repr=False on attrs fields.

    5.2.0release notes

  • Non-retryable DiskRetryer responses are no longer treated as success.

    5.2.0release notes

  • Fixes handling of explicit context for Logfire metrics.

    5.2.0release notes

  • Prevents duplicate telemetry from FastAPI instrumentation.

    5.2.0release notes

  • Fixes an issue when Logfire accesses a file without permission.

    5.2.0release notes

  • Updates Google GenAI instrumentation.

    5.2.0release notes

  • Logfire supports OpenTelemetry 1.45.

    5.2.0release notes

  • Fixes retries for OTLP byte POST requests made through Session.request.

    5.2.0release notes

  • Keeps the span message synchronized with its name after update_name.

    5.2.0release notes

  • Logfire's HTTP sessions enable TCP keepalive and recycle idle connections.

    5.1.1release notes

  • Project setup now handles accounts without organizations.

    5.1.1release notes

  • Prevents OpenTelemetry logging from deadlocking during force_flush().

    5.1.0release notes

  • Preserves the selected region or custom base URL throughout setup.

    5.1.0release notes

  • Requires directory boundaries when identifying non-user code paths.

    5.1.0release notes

  • Continues project selection and verification after browser authentication.

    5.1.0release notes

  • Failures from every force_flush pipeline are reported.

    5.0.0release notes

  • Project setup can finish without a TTY.

    5.0.0release notes

  • OpenAI cost is preserved on deduplicated Agents spans.

    5.0.0release notes

  • Supports opentelemetry-instrumentation-google-genai 1.0 and later.

    5.0.0release notes

  • Span exports now handle backend 413 responses.

    5.0.0release notes

logfire 4136 changes

Breaking changes 19

  • Limits HTTP connection attempts to three seconds.

    4.41.0release notes

  • Warns when a token's region is unrecognised instead of silently defaulting to US, including outside configuration.

    4.41.0release notes

  • Removed logfire.variables_clear because it is for tests, not users.

    4.40.0release notes

  • Transient variables-refresh failures are logged as warnings instead of errors.

    4.40.0release notes

  • Marks recommendations in run summaries that are ambiguous.

    4.38.0release notes

  • Disables console logging for the 'Logfire configured' log.

    4.37.0release notes

  • Call logfire.configure() before using lazy remote variables.

    4.36.0release notes

  • Python 3.9 is no longer supported.

    4.34.0release notes

  • Drops support for Python versions below 3.9.2.

    4.33.0release notes

  • export_dataset is merged into get_dataset.

    4.30.0release notes

  • Project URLs are no longer styled as Rich links in output.

    4.30.0release notes

  • The logfire_pytest fixture scope changed to session.

    4.28.0release notes

  • The redundant logfire.experimental.datasets package was deleted.

    4.28.0release notes

  • Handled exceptions in FastAPI create issues when the status code is 5xx.

    4.19.0release notes

  • Support OpenTelemetry 1.39.0 and drop support for earlier versions.

    4.16.0release notes

  • Retried exports are limited based on total size rather than the number of exports.

    4.15.0release notes

  • Exceptions are no longer recorded on NonRecordingSpan instances.

    4.14.1release notes

  • Extra FastAPI spans are no longer emitted by default.

    4.0.0release notes

  • Deprecated process runtime metrics are no longer emitted implicitly.

    4.0.0release notes

Security 2

  • The default scrubbing patterns now include pylf_v\d+_.

    4.36.0release notes

  • The cf-connecting-ip header is now stripped in forward_export_request.

    4.31.1release notes

Deprecations 4

  • Calling query_arrow() without providing min_timestamp is deprecated.

    4.35.0release notes

  • Calling query_csv() without providing min_timestamp is deprecated.

    4.35.0release notes

  • The query_json() method is deprecated; use query_json_rows() instead.

    4.35.0release notes

  • Calling query_json_rows() without providing min_timestamp is deprecated.

    4.35.0release notes

New APIs and options 35

  • Adds a non-interactive CLI option.

    4.41.0release notes

  • Adds a JSON output option to the projects list command.

    4.41.0release notes

  • Adds the system.cpu.load_average.1m metric.

    4.41.0release notes

  • Adds the system.process.count metric.

    4.41.0release notes

  • Adds TypedDict types and TypeAdapter validation to the datasets API client.

    4.38.0release notes

  • Adds the resource_attributes option to logfire.configure.

    4.38.0release notes

  • Adds the resource_detectors option to logfire.configure.

    4.38.0release notes

  • Adds support for content parts in the OpenAI Responses API.

    4.38.0release notes

  • Composition and templating are available with native handlebars.

    4.36.0release notes

  • LogfireQueryClient and AsyncLogfireQueryClient support the new /v2/query endpoint with backwards-compatible changes.

    4.35.0release notes

  • Adds a Starlette method for forwarding export requests.

    4.34.0release notes

  • Adds a method for forwarding export requests.

    4.34.0release notes

  • Exposes the reason on ResolvedVariable.

    4.34.0release notes

  • Adds support for capturing parameters in the asyncpg integration.

    4.33.0release notes

  • A configuration log can optionally be emitted after logfire.configure().

    4.33.0release notes

  • The Datasets SDK can upload dataset-level evaluators.

    4.33.0release notes

  • Adds a level parameter to @logfire.instrument().

    4.33.0release notes

  • The Datasets SDK can upload report-level evaluators.

    4.33.0release notes

  • Adds support for TaskSpanData from openai-agents 0.14.

    4.33.0release notes

  • Adds push_dataset helpers to the experimental API client.

    4.32.0release notes

  • Adds an instrumentation function for the Claude Agent SDK.

    4.31.0release notes

  • Adds a method that derives a URL from an evaluation report.

    4.31.0release notes

  • Merges export_dataset into get_dataset, adding the include_cases parameter.

    4.30.0release notes

  • Adds a browser proxy helper for forwarding export requests.

    4.26.0release notes

  • Adds a browser proxy helper.

    4.26.0release notes

  • An experimental datasets package was added.

    4.25.0release notes

  • Managed variables are now available.

    4.24.0release notes

  • Adds a PEP 249 DB API 2.0 interface for using Logfire with database APIs.

    4.23.0release notes

  • Logfire adds a DSPy integration for instrumenting DSPy applications.

    4.19.0release notes

  • Adds request body capture for aiohttp requests.

    4.18.0release notes

  • Adds instrumentation for the Claude SDK.

    4.18.0release notes

  • Adds instrumentation for SurrealDB.

    4.17.0release notes

  • Allows custom Views in MetricOptions.

    4.17.0release notes

  • ProxyLogger emit() now supports kwargs.

    4.16.0release notes

  • Adds the new_trace parameter to logfire.instrument.

    4.16.0release notes

Performance 2

  • Speeds up default scrubbing pattern matching.

    4.41.0release notes

  • Avoids a full response model_dump during usage cost processing.

    4.33.0release notes

Behavior and default changes 26

  • Variable fetching uses ETags and conditional GET, handling 304 responses silently.

    4.40.0release notes

  • logfire.instrument_httpx() now supports httpx2.

    4.39.0release notes

  • Routes managed variables according to API key region.

    4.38.0release notes

  • Pre-populates host.* and os.* resource attributes.

    4.37.0release notes

  • Adds db.query.text to the scrubber's SAFE_KEYS.

    4.34.0release notes

  • Propagates the variable version in baggage alongside the label.

    4.34.0release notes

  • Telemetry is forwarded in a separate thread.

    4.34.0release notes

  • Adds logfire.version to resource attributes.

    4.33.0release notes

  • Adds support for TurnSpanData from openai-agents 0.14.

    4.33.0release notes

  • Various genai attributes are now safe from scrubbing.

    4.32.1release notes

  • Token badges are now shown for OpenAI streaming logs.

    4.31.2release notes

  • Anthropic streaming logs now capture token usage and cost attributes.

    4.31.1release notes

  • Anthropic instrumentation now captures gen_ai.usage.raw.

    4.31.1release notes

  • OpenAI streaming logs now capture token usage and cost attributes.

    4.31.1release notes

  • OpenAI embeddings now capture the operation.cost attribute.

    4.31.1release notes

  • OpenAI Responses spans now include the gen_ai.usage.raw attribute.

    4.29.0release notes

  • Anthropic spans now include the gen_ai.system attribute, enabling token and cost badges.

    4.27.0release notes

  • Anthropic spans include the operation.cost attribute when genai-prices is installed.

    4.27.0release notes

  • Uses additionalProperties for schemas representing homogeneous dictionaries.

    4.26.0release notes

  • Supports traceparent propagation with pytest-xdist.

    4.23.0release notes

  • Adds semantic convention message attributes to LLM integrations.

    4.23.0release notes

  • Project migration now supports multiple tokens.

    4.22.0release notes

  • Handles LangChain reasoning summaries.

    4.21.0release notes

  • Adds OTel Gen AI semantic convention scalar attributes.

    4.21.0release notes

  • Log levels are set based on HTTP status codes in FastAPI.

    4.19.0release notes

  • LLM instrumentations add OTel GenAI semantic convention attributes.

    4.19.0release notes

Tooling 6

Fixes and other changes 42

  • Fixes two races in tool-use hook instrumentation.

    4.41.0release notes

  • Bounds INSERT summary length like the SELECT path.

    4.41.0release notes

  • Keeps the data directory gitignored after running the clean command.

    4.41.0release notes

  • Adds a timeout to outbound HTTP session requests.

    4.41.0release notes

  • Parents slow-async-callback spans to the running task.

    4.41.0release notes

  • Fixed a circular reference in the span event body for google-genai.

    4.40.0release notes

  • Fixed three SSE reliability gaps in the remote variable provider.

    4.40.0release notes

  • Fixed the metric resource PID after a fork.

    4.40.0release notes

  • Logfire supports OpenTelemetry SDK 1.44.0.

    4.39.0release notes

  • Prevents ConnectionErrors from being retried twice.

    4.38.0release notes

  • Supports using logfire.instrument as a bare decorator.

    4.38.0release notes

  • Guards against None text in Anthropic TextBlock during streaming.

    4.37.0release notes

  • Handles non-finite floats in JSON encoding.

    4.37.0release notes

  • Avoids truncating rich console arguments.

    4.37.0release notes

  • The token pattern now accepts organization IDs for API keys.

    4.35.0release notes

  • Logfire supports OpenTelemetry SDK 1.42.

    4.35.0release notes

  • Handles errors raised by traceback.format_exception.

    4.34.0release notes

  • Adds support for OTel 1.41.0.

    4.33.0release notes

  • Open spans end earlier during process shutdown to prevent dangling pending spans.

    4.33.0release notes

  • Running the prompt command without --project no longer raises an error.

    4.33.0release notes

  • Updates the integration for SurrealDB 2.x.

    4.33.0release notes

  • Surfaces the X-Logfire-Warning header.

    4.33.0release notes

  • Logfire supports OpenTelemetry SDK 1.40.0, which may affect which SDK version developers can use.

    4.32.1release notes

  • Fixes an OTel warning during tail sampling buffer replay.

    4.31.2release notes

  • Patching of sys.stdout is handled better.

    4.31.1release notes

  • Handles bare MCP request types for fastmcp 3.x compatibility.

    4.31.0release notes

  • Anthropic input token usage now includes cached tokens.

    4.31.0release notes

  • Fixes push_config() so it pushes labels and versions.

    4.30.0release notes

  • Anthropic beta messages are handled.

    4.28.0release notes

  • Handles pickling errors raised in dataclasses.asdict.

    4.26.0release notes

  • Fixes some attributes in spans for langsmith and openai_agents.

    4.23.0release notes

  • Re-attaches OTel span context in pytest async test functions.

    4.23.0release notes

  • Fixes a crash in the google_genai integration when Gemini returns parts=None.

    4.22.0release notes

  • Fixes streaming error handling so it does not mask original errors.

    4.21.0release notes

  • Anthropic response data now includes the tool call ID.

    4.20.0release notes

  • Maintains the original LLM request context when logging the streaming response.

    4.17.0release notes

  • Handles unpicklable configuration in the ProcessPoolExecutor patch.

    4.17.0release notes

  • Fixes a JSON serialization error with instrument_google_genai.

    4.16.0release notes

  • Functions instrumented with logfire.instrument are now cloudpicklable.

    4.15.1release notes

  • Headers from OTEL_EXPORTER_OTLP_HEADERS no longer override the Logfire token.

    4.14.2release notes

  • Fixes instrument_google_genai.

    4.14.0release notes

  • Adds support for OpenTelemetry 1.38.

    4.14.0release notes