# What changed in langfuse

> 116 changes in langfuse 4 to 5 from its official release notes, upgrade guides and advisories: 66 breaking, 7 deprecations, 1 security, 21 new APIs and options. Each one cited. Sources checked 2026-10-20. HTML: https://unstale.sh/pypi/langfuse/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## langfuse 5

### Breaking changes

- Previously deprecated public API methods are removed, including api.trace.get/list, api.sessions.*, api.legacy.*, api.ingestion.batch, and several dataset and score methods; use the documented replacements. (5.0.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1)
- The SDK requires Python 3.11 or later; installing it on Python 3.10 installs the latest v4 instead. (5.0.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1)
- fetch_trace_fields is renamed to fields, which defaults to core,basic,io,metadata. (5.0.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1)
- The filter must now be a v2 filter JSON array. (5.0.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1)
- The ingestion batch method is removed; use SDK tracing through OpenTelemetry for traces and api.scores.create for scores. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The api.legacy namespace is removed; use the listed observations, metrics, and scores API replacements. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- This method is gone; create scores with api.scores.create(request=[...]) instead. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- This method moves to api.scores.delete(score_id=...). (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The scores_v3 namespace no longer exists; use api.scores.get_many with the same arguments and response. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Score creation now takes a list of CreateScoreRequest objects as request=; partial acceptance returns accepted and rejected counts and errors. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- This method now behaves like scores_v3.get_many_v3; filter by id= for comma-separated score IDs instead of score_ids=. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The sessions API methods are removed; retrieve observations with api.observations.get_many(session_id=...). (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Removed; retrieve trace observations with api.observations.get_many(trace_id=...). (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- This Langfuse argument is removed; combine should_export_span with the default filter instead. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The GenAI check requires the gen_ai. prefix including its dot, so attributes such as gen_ai_custom no longer count. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The dataset run helper is removed; list experiment items and delete their traces with api.trace.delete_multiple instead. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The dataset run helper is removed; use the experiments API instead. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The dataset run helper is removed; use the experiments API instead. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The LangChain integration requires langchain-core 1 or later; importing it with an older version raises ModuleNotFoundError. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The SDK supports Langfuse Cloud or self-hosted Langfuse v4.59.0 or later; self-hosted v3 and older v4 releases are unsupported. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Use this environment variable to set the release instead of the removed `release` trace attribute. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Use this environment variable to set the tracing environment instead of the removed `environment` trace attribute. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Now points to the Metrics v2 endpoint; use the legacy v1 namespace when querying a self-hosted Langfuse v3 server. (4.0.0, 5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Now points to the Observations v2 endpoint; use the legacy v1 namespace when querying a self-hosted Langfuse v3 server. (4.0.0, 5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- The v2 score resource is now exposed as `langfuse.api.scores`; the v2 alias was removed. (4.0.0, 5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Metadata attribute values, including strings, are JSON-encoded; exporters that read or write them should decode with json.loads and encode replacements with json.dumps. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Replaces setting trace publicity through `.updateTrace()`. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Propagated metadata must be a `Record<string, string>`; the migration checklist also specifies values of at most 200 characters. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- The OpenAI integration requires openai 1.0 or later and no longer supports pre-1.0 SDKs. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- V4 resume tokens cannot be reused, and resuming with a different filter raises ValueError. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- _additional_trace_tags is removed. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Evaluation now reads v2 observations only; fetch_trace_fields becomes fields, filter must be a v2 JSON array, and the mapper receives an observation with raw-string input and output. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Batched evaluation now reads from the v2 observations API and evaluates observations only; scope is removed. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The trace input/output setter is removed; set input and output on the root observation instead. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Replaces setting the trace's `public` attribute through `updateActiveTrace()`. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- OpenTelemetry spans are now filtered by default to Langfuse spans, spans with `gen_ai.*` attributes, and spans from known LLM instrumentation scopes. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- The trace input/output setter is removed; set input and output on the root observation instead. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Set trace input and output on the root observation using span.update(input=..., output=...). (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Trace updates are decomposed into attribute propagation, trace I/O setting, and trace-publicity APIs. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)

### Deprecations

- Deprecated for backward compatibility with trace-level LLM-as-a-judge evaluators. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Deprecated for backward compatibility with trace-level LLM-as-a-judge evaluators; new code should set input/output on the root observation. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)

### New APIs and options

- Accepts a caller-supplied experiment_id when running an experiment. (5.0.3) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.3)
- Lets custom `shouldExportSpan` rules compose with the default span-filtering behavior. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Set this environment variable to none if a proxy rejects gzip-compressed span batches. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Provides access to the legacy Metrics v1 API, including for self-hosted Langfuse v3 servers. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Provides access to the legacy Observations v1 API, including for self-hosted Langfuse v3 servers. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Provides access to the legacy Score v1 API. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Dataset versions are recorded on experiment items, including items from local-data runs. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Wraps a callback so the current and child observations created within its scope inherit correlating attributes. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5)
- Experiment results now expose an experiment ID that links directly to the experiment comparison view. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Experiment results now expose a URL that links directly to the experiment comparison view. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)

### Performance

- Tracing skips span attribute limit checks when the span has room, reducing unnecessary checks. (5.0.2) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.2)

### Behavior and default changes

- Pending scores are sent immediately when flush() is called. (5.0.3) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.3)
- Metadata attribute values, including strings, are JSON-encoded; exporters that read or write them should decode with json.loads and encode replacements with json.dumps. (5.0.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1)
- Scores are sent in batches; partial HTTP 207 rejections and other 4xx responses are logged without retry, while network errors, 429, and 5xx responses are retried with backoff. (5.0.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1)
- Pass a list of CreateScoreRequest objects as request; responses include accepted and rejected counts and errors when some scores are rejected. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- The handler now imports only from langchain_core, so the langchain meta-package is no longer needed; its import path and usage are unchanged. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Correlating attributes propagate to every observation instead of living only on the trace, enabling single-table queries without expensive joins. (4.0.0, 5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v4-to-v5), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Experiments are recorded through OpenTelemetry; sampled-out items and their scores do not reach Langfuse when sample_rate is below 1, while run-level scores are always stored. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Metadata sent with v5 preserves numeric and boolean types, and nested objects can be filtered by dotted path. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)

### Fixes and other changes

- The mapper receives an observation whose input and output are raw strings. (5.0.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1)
- Set otel_compression to none if a proxy rejects gzip-compressed span batches. (5.0.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v5.0.1), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)
- Use the default sample_rate=1.0 client for complete experiments. (5.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v4-to-v5)

## langfuse 4

### Breaking changes

- The LangChain handler's `update_trace` parameter no longer exists; passing it raises a `TypeError`. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Use the Experiment SDK method to run dataset experiments; it handles propagation of experiment attributes and dataset item linking. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- The dataset item `run()` method was removed; use `dataset.run_experiment()` to run experiments and handle experiment attribute propagation. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- getTraceUrl is now asynchronous and returns a promise, so callers should await it. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- The package and LangfuseClient class are now for non-tracing features such as scoring, prompt management, and datasets. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- Import the Langchain integration from @langfuse/langchain. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- Import the OpenAI integration from @langfuse/openai. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- Set this environment variable to provide the release value; the `release` argument to `update_current_trace()` was removed. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- For Vercel AI SDK integration, replace LangfuseExporter from langfuse-vercel with LangfuseSpanProcessor from @langfuse/otel. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- This type is no longer re-exported from `langfuse.types`; import it from `langfuse.model` instead. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Provided tool definitions to the LLM are now mapped to metadata.tools rather than input.tools, which matters when evaluating generations. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- This type is no longer re-exported from `langfuse.types`; import it from `langfuse.model` instead. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- This TypedDict was removed from `langfuse.types`. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- The SDK no longer exports all OpenTelemetry spans by default; it exports Langfuse-created spans, spans with `gen_ai.*` attributes, and spans from known LLM instrumentation scopes. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- This type is no longer re-exported from `langfuse.types`; import it from `langfuse.model` instead. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Use this context manager to apply correlating attributes to the current observation and all child observations created within its scope. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Propagated metadata must be `dict[str, str]`; non-string values are coerced to strings, and values over 200 characters are dropped with a warning. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- The SDK now requires Pydantic v2; applications still using Pydantic v1 must use the `pydantic.v1` compatibility shim. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Use this method to set the current trace's public flag, replacing `update_current_trace(public=True)`. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Use this observation method to set the trace's public flag, replacing `span.update_trace(public=True)`. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Observation-level trace updates are decomposed into `propagate_attributes()`, `set_trace_io()`, and `set_trace_as_public()`. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- This unified context-managed API replaces separate current-span and current-generation methods; use `as_type` to specify the observation type. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Use startObservation and related functions from @langfuse/tracing in place of langfuse.trace(), langfuse.span(), and langfuse.generation(). (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- This TypedDict was removed from `langfuse.types`. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Trace updates are decomposed: use `propagate_attributes()` for correlating attributes, `set_current_trace_io()` for legacy trace I/O, and `set_current_trace_as_public()` for the public flag. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Values are validated as strings with a maximum length of 200 characters; longer values are dropped with a warning. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Pass version as an optional property in the options object to langfuse.prompt.get() instead of as a positional argument. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)

### Security

- The serializer now masks Pydantic secret values. (4.15.4) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.15.4)

### Deprecations

- This option still works but is deprecated; migrate its denylist behavior to a `should_export_span` callback. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- The Langfuse base URL environment variable is now LANGFUSE_BASE_URL; LANGFUSE_BASEURL remains backward compatible in v4 but will not work in future versions. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- LANGFUSE_BASEURL still works for backward compatibility in v4, but will not work in future versions. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- This method remains for backward compatibility with trace-level LLM-as-a-judge evaluators; new code should set input and output on the root observation. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- This observation method is deprecated; set input and output on the root observation directly for new code. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)

### New APIs and options

- Adds opt-in gzip compression for the default OTLP exporter. (4.17.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.17.0)
- Import this helper from `langfuse.span_filter` to compose custom span filters with the default export behavior. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- The package is for tracing and provides the LangfuseSpanProcessor used with OpenTelemetry. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- The package is for tracing, including the replacement tracing functions. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- Set the tracing environment via the LANGFUSE_TRACING_ENVIRONMENT environment variable. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4), [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Set the tracing release via the LANGFUSE_TRACING_RELEASE environment variable. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- Use this namespace for legacy v1 metrics queries, including when a Python SDK v4 client temporarily queries a self-hosted Langfuse v3 server. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Use this namespace for legacy v1 observation queries, including when a Python SDK v4 client temporarily queries a self-hosted Langfuse v3 server. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Use this namespace for legacy v1 score queries. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)
- Register LangfuseSpanProcessor with an OpenTelemetry NodeSDK to set up tracing in the v4 SDK. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/js-v3-to-v4)
- Set this Langfuse client option to control which spans are exported, including preserving export-all behavior or composing a custom filter with the default. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)

### Performance

- Span processing skips span_formatter when debug logging is off, avoiding unnecessary formatting work. (4.15.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.15.1)

### Behavior and default changes

- Default exporter batches are capped at 64 MiB. (4.16.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.16.0)
- Values are validated as strings with a maximum length of 200 characters; longer values are dropped with a warning. (4.0.0) — [upgrade guide](https://langfuse.com/docs/observability/sdk/upgrade-path/python-v3-to-v4)

### Fixes and other changes

- Dataset JSON-schema response fields are typed as objects. (4.18.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.18.0)
- Read-side metadata is typed as optional objects. (4.18.0) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.18.0)
- Langfuse now captures reasoning_effort in model parameters. (4.15.6) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.15.6)
- Langfuse now captures verbosity in model parameters. (4.15.6) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.15.6)
- NaN/Inf values nested in converted containers are now sanitized during serialization. (4.15.5) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.15.5)
- The API specification was updated from upstream Langfuse changes. (4.15.1) — [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.15.2), [release notes](https://github.com/langfuse/langfuse-python/releases/tag/v4.15.1)
