Skip to content

chore(observability): migrate Langfuse observability to v4 OTLP ingestion - #490

Open
Mike3285 wants to merge 4 commits into
vxcontrol:mainfrom
Mike3285:feat/langfuse-v4-otlp
Open

Mike3285 wants to merge 4 commits into
vxcontrol:mainfrom
Mike3285:feat/langfuse-v4-otlp

Conversation

@Mike3285

@Mike3285 Mike3285 commented Nov 10, 2026 •

Copy link
Copy Markdown

Migrates the Langfuse observability client from legacy ingestion events to v4 OTLP exports. Observations are exported once on completion, with trace context, model parameters, usage, costs, and timing mapped to OTLP attributes; scores use the score API.

Preserves trace identity and metadata when flow and assistant workers create detached contexts or reload persisted workers, and supplies input on their initial preparation spans. Updates the default Langfuse web and worker images to v4 and ClickHouse to 26.4 in Compose and the example environment. Exposes the v4 migration settings for both services, retaining native v4 defaults with historic backfill enabled. Documents the staged v3 upgrade, existing environment overrides, and historic data migration.

Validation: go test ./pkg/observability/langfuse ./pkg/tools ./pkg/controller passes. Coverage includes observation types, scores, context propagation, single export on completion, oversized payload splitting, and executor trace relationships. git diff --check passes. Docker Compose configuration validates both without an environment file and with .env.example; rendered images and shared migration settings were checked for both web and worker.

Review limitation: no live Langfuse v4 instance or Docker upgrade was exercised. Observations now become visible after completion; existing shutdown behavior drops buffered data. Operators should review the Langfuse upgrade procedure before updating a persisted deployment.

…e v4 OTLP

Export observations as OTLP spans via POST /api/public/otel/v1/traces with x-langfuse-ingestion-version: 4 and scores via POST /api/public/scores. Emit timed observations once on End() with start and end timestamps, propagate TraceContext attributes to child observations, and preserve HTTP 413 batch splitting.
…put in workers

Attach trace context and root span input to flow and assistant background worker contexts so child observations inherit userId, sessionId, tags, and metadata, and restore TraceID when loading existing assistant workers.
@Mike3285 Mike3285 changed the title Migrate Langfuse observability to v4 OTLP ingestion (chore): migrate Langfuse observability to v4 OTLP ingestion Nov 10, 2026
@Mike3285 Mike3285 changed the title (chore): migrate Langfuse observability to v4 OTLP ingestion chore(observability): migrate Langfuse observability to v4 OTLP ingestion Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant