Problem/Motivation
Langfuse v4 replaces the legacy batch ingestion API with OpenTelemetry (OTLP) ingestion. On a self-hosted v4 instance in the default events_only write mode, POST /api/public/ingestion returns HTTP 400 for every trace / span / generation event and only still accepts score-create and sdk-log. On Langfuse Cloud the legacy endpoint is sunset on 2026-11-16.
The module depends on dropsolid/langfuse-php-sdk (~1.2.0), whose ClientConfig::getIngestionUrl() hardcodes /api/public/ingestion. The SDK's 1.3.x line is described upstream as a "parity pass against the LangFuse v3 platform" and also has no OTLP support.
Result: against a Langfuse v4 server, every trace produced by this module (and langfuse_ai_logging) is rejected and silently lost. Only scores (feedback) still arrive.
References:
- https://langfuse.com/self-hosting/upgrade/upgrade-guides/upgrade-v3-to-v4
- https://langfuse.com/faq/all/deprecated-api-migration
- https://langfuse.com/docs/compatibility
Steps to reproduce
- Run Langfuse v4 (default write mode).
- Enable langfuse + langfuse_ai_logging, point it at the v4 host.
- Trigger any AI request. Traces never appear; the SDK logs "Batch ingestion contained errors" / 400 per event.
Proposed resolution
- Add OTLP ingestion (
POST /api/public/otel/v1/traces, protobuf or JSON) either in the SDK or as an alternative client in the module, mapping trace/span/generation to OTEL spans with thelangfuse.*attributes described in the v4 custom ingestion migration guide. - Keep
score-createon/api/public/ingestion(still supported on v4). - Document the supported Langfuse server versions on the project page.
Remaining tasks
- Decide whether OTLP support lands in dropsolid/langfuse-php-sdk or in this module.
- Implement + test against Langfuse v4.
- Update composer constraint and project page.
This issue was created with the help of an LLM
Comments
Comment #2
stmh commentedComment #3
stmh commentedComment #4
nikro commentedHi @stmh,
Thanks for the heads-up - we wanted originally to do a module v1.1 and then do the sdk 2.0 -> and further module updates, but we decided to change this. We're moving sdk to 2.0 and we'll release module 1.1 against 2.x of the sdk (targeting the new OTEL).
On why - >= v3.22 - already has OTEL support, so this actually allows the future module v1.1 to cover both v3.x (>.22) and v4 :)
Will keep you up to date here.
Comment #5
nikro commentedHey - can you please review the new version of the code AND the SDK?
Hint: https://git.drupalcode.org/project/langfuse/tree/2.0.0-alpha1
Lots of things reworked last week. I did multiple tests: deepchat, ai_agents, ai_answers, ai_search_block, all worked out pretty well, against both v3 and v4.
LMK!
Comment #8
nikro commentedRelease alpha2 (with CI/CD fixes).