npm / langfuse
langfuse
What changed in langfuse 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-06.
24 breaking2 deprecations17 new APIs and options7 behavior and defaults
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initlangfuse 628 changes
Breaking changes 14
The legacy namespace and deprecated public API methods are removed; use their documented replacements.
Removed; create scores with
api.scores.create([...])instead.Accepts an array of
CreateScoreRequestobjects and can report partial acceptance throughaccepted,rejected, anderrors; the response no longer contains the scoreid.Use this method to delete a score; it replaces
api.legacy.scoreV1.delete(scoreId).Now behaves like the former
api.scoresV3.getManyV3; filter scores byidrather thanscoreIds.Removed with no alias; use
api.scores.getManyfor score reads.Dataset items are now plain
DatasetItem[]withoutlink(); use the experiment runner instead.The SDK requires Langfuse Cloud or self-hosted Langfuse v4.59.0 or later; self-hosted v3 and earlier v4 releases are unsupported.
The LangChain integration now requires
@langchain/core@^1.0.0; older versions cause a peer dependency conflict.Now sends scores to
POST /api/public/scoresusing public-key authentication.Deprecated top-level convenience methods such as
getPrompt,getDataset, andfetchTraceare removed; use the managers or API client replacements.Metadata values, including strings, are JSON-encoded on spans; custom processors and exporters reading these attributes need to parse them with
JSON.parse().v6 requires Node.js 22 or later; packages are compiled to ES2022, so bundles for older runtimes must transpile the SDK.
Removed along with
span.setTraceIO()andcreateTraceAttributes(); set trace input and output on the root observation instead.
New APIs and options 9
Batch score creation accepts an array of
CreateScoreRequestobjects.Set
compression: "none"onLangfuseSpanProcessorto disable gzip compression when a proxy rejects compressed requests.Experiment results now provide
result.experimentUrl, linking directly to the experiment comparison view.LangfuseClientnow exposesgetExperimentUrl(experimentId)to get an experiment URL.LangfuseClientnow exposesgetProjectId().Set to
noneto disable span-batch gzip compression when a proxy rejects compressed requests.Dataset versions are recorded on experiment items using this attribute.
Metadata sent with v6 can be filtered by dotted paths such as
a.b = 1; numeric and boolean comparisons are not supported yet.Affected generated API methods now take an optional
requestargument beforerequestOptions; pass{}when supplying options to methods without query parameters or a body.
Behavior and default changes 5
Experiments are recorded through OpenTelemetry; sampled-out item traces do not appear in the experiment, while run-level scores are always stored.
A
LangfuseSpanProcessormask function receives decoded observation metadata, which may be a number, boolean, or object rather than a string.Scores are sent in batches of up to 100 to
POST /api/public/scoresinstead of the legacy ingestion endpoint; rejected scores in partial responses are logged and not retried.Score methods validate input on the client and never throw; scores with an empty name or invalid value are logged and dropped.
Span batches are gzip-compressed on Node.js and Bun; browser and edge runtimes do not compress.
langfuse 522 changes
Breaking changes 10
Use this environment variable to set the release instead of the removed
releasetrace attribute.Use this environment variable to set the tracing environment instead of the removed
environmenttrace attribute.Now points to the Metrics v2 endpoint; use
langfuse.api.legacy.metricsV1for a self-hosted Langfuse v3 server.Now points to the Observations v2 endpoint; use
langfuse.api.legacy.observationsV1for a self-hosted Langfuse v3 server.Propagated metadata now requires
Record<string, string>values, with values no longer than 200 characters.By default, exports Langfuse-created spans, spans with
gen_ai.*attributes, and spans from known LLM instrumentation scopes instead of exporting all spans.A custom callback is a full override of the default span filter; compose with
isDefaultExportSpanto extend the default behavior.Trace updates are split among
propagateAttributes(),setActiveTraceIO(), andsetActiveTraceAsPublic().Observation wrapper trace updates are split into
propagateAttributes(),.setTraceIO(), and.setTraceAsPublic().The transitional
observationsV2,scoreV2, andmetricsV2aliases were removed; use the default resource names instead.
Deprecations 2
Deprecated for new code; set input and output on the root observation directly. It remains for backward compatibility with trace-level evaluators.
Deprecated for new code; set input and output on the root observation directly. It remains for backward compatibility with trace-level evaluators.
New APIs and options 8
Checks the default span-filter rules so custom
shouldExportSpanlogic can extend rather than replace them.Provides the legacy v1 metrics resource, including for compatibility with self-hosted Langfuse v3.
Provides the legacy v1 observations resource, including for compatibility with self-hosted Langfuse v3.
Provides the legacy v1 score resource.
The v2 score resource is now the default Public API resource under this name.
Wraps a callback and applies correlating attributes to child observations created within its scope.
Replaces setting the trace's
publicattribute throughupdateActiveTrace().Replaces setting the trace's
publicattribute through.updateTrace().
Behavior and default changes 2
Non-string
traceMetadatavalues are serialized withJSON.stringifybefore being passed topropagateAttributes().Correlating attributes propagate to every observation rather than living only on the trace, enabling single-table queries and improving query performance at scale.