Skip to content

fix: make LANGFUSE_BASE_URL the preferred URL variable#12154

Merged
mendonk merged 5 commits into
mainfrom
fix-langfuse-hose-and-base-url-mismatch
Mar 13, 2026
Merged

fix: make LANGFUSE_BASE_URL the preferred URL variable#12154
mendonk merged 5 commits into
mainfrom
fix-langfuse-hose-and-base-url-mismatch

Conversation

@mendonk
Copy link
Copy Markdown
Collaborator

@mendonk mendonk commented Mar 11, 2026

Langflow previously used LANGFUSE_HOST as the variable for the Langfuse base URL.
If you copy values from Langfuse, it now uses LANGFUSE_BASE_URL.

This pull request makes LANGFUSE_BASE_URL the preferred environment variable, and includes LANGFUSE_HOST for backward compatibility. LANGFUSE_BASE_URL will be used if both values are set. None host is returned if neither (which is the current behavior).

Docs are updated to use the LANGFUSE_BASE_URL value, and includes a note for users that may still be using LANGFUSE_HOST.

Summary by CodeRabbit

  • Documentation

    • Updated Langfuse integration setup instructions with renamed environment variable and API key nomenclature.
    • Added backward compatibility note for existing configurations.
    • Standardized .env file workflow in setup examples.
  • Chores

    • Updated environment variable resolution logic to prioritize new naming convention while maintaining backward compatibility.

@mendonk mendonk self-assigned this Mar 11, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 11, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f5c7cd8b-ebad-4430-be34-7aec95872649

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR updates the Langfuse integration to rename the host configuration environment variable from LANGFUSE_HOST to LANGFUSE_BASE_URL while maintaining backward compatibility. Both documentation and service code are updated to reflect this change.

Changes

Cohort / File(s) Summary
Documentation Updates
docs/docs/Develop/integrations-langfuse.mdx
Renamed environment variable from LANGFUSE_HOST to LANGFUSE_BASE_URL across all examples, instructions, and docker-compose configurations. Updated terminology from "Host URL" to "Base URL" and adjusted API key labeling. Added backward compatibility note indicating LANGFUSE_HOST remains supported.
Service Implementation
src/backend/base/langflow/services/tracing/langfuse.py
Updated environment variable resolution to read LANGFUSE_BASE_URL as primary source with fallback to LANGFUSE_HOST for backward compatibility.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error PR modifies langfuse.py environment variable resolution logic but includes no test files to verify the changes work correctly. Add test coverage verifying LANGFUSE_BASE_URL priority over LANGFUSE_HOST, fallback behavior, and backward compatibility.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Quality And Coverage ⚠️ Warning No tests added or modified to verify the new environment variable precedence behavior in langfuse.py configuration function. Add unit tests covering: (1) LANGFUSE_BASE_URL set scenario, (2) LANGFUSE_HOST backward compatibility, (3) precedence when both variables exist, (4) neither variable case.
Test File Naming And Structure ❓ Inconclusive No test files are created or modified in this PR. The changes only affect documentation and one backend file for Langfuse environment variable resolution. Determine if tests should be added to cover the Langfuse configuration changes, or clarify if this check applies to this particular PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and accurately summarizes the main objective: making LANGFUSE_BASE_URL the preferred URL variable for Langfuse integration.
Excessive Mock Usage Warning ✅ Passed PR modifies only documentation and one config method; no test files added or modified, so custom check for excessive mock usage is not applicable.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-langfuse-hose-and-base-url-mismatch
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the bug Something isn't working label Mar 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 11, 2026

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 24%
24.14% (8609/35660) 16.89% (4743/28067) 16.87% (1261/7473)

Unit Test Results

Tests Skipped Failures Errors Time
2776 0 💤 0 ❌ 0 🔥 45.012s ⏱️

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Mar 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 38.40%. Comparing base (aea0796) to head (781f884).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...backend/base/langflow/services/tracing/langfuse.py 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (44.26%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12154   +/-   ##
=======================================
  Coverage   38.39%   38.40%           
=======================================
  Files        1630     1630           
  Lines       80290    80290           
  Branches    12120    12120           
=======================================
+ Hits        30830    30834    +4     
+ Misses      47724    47719    -5     
- Partials     1736     1737    +1     
Flag Coverage Δ
backend 57.31% <0.00%> (+0.02%) ⬆️
frontend 21.56% <ø> (ø)
lfx 44.26% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...backend/base/langflow/services/tracing/langfuse.py 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/docs/Develop/integrations-langfuse.mdx`:
- Around line 44-54: Add missing title attributes to the code fences shown in
the diff: update the first ```bash fence containing the env vars to ```bash
title=".env", change the ```bash fence with the uv run command to ```bash
title="terminal", change the ```yml fence for the docker-compose snippet to
```yml title="docker-compose.yml", and change the ```sh fence with the docker
compose exec command to ```sh title="terminal" so all code blocks follow the
docs standard; locate these by the existing fences (```bash, ```yml, ```sh) and
the shared snippet contents to apply the titles.
- Around line 133-136: The troubleshooting note is misleading because the sample
command reads LANGFUSE_BASE_URL inside the langflow container; update the text
to instruct users to set LANGFUSE_BASE_URL in the docker compose service's
environment section (not their host shell) and then recreate/restart the
langflow service so the container picks up the change (e.g., recreate the
service via docker compose up -d or equivalent), while keeping the existing
docker compose exec langflow python... check as the validation step.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 83a416de-89cb-4e1b-9b89-daf15846f0c6

📥 Commits

Reviewing files that changed from the base of the PR and between 911bc9d and 913eeb3.

📒 Files selected for processing (2)
  • docs/docs/Develop/integrations-langfuse.mdx
  • src/backend/base/langflow/services/tracing/langfuse.py

Comment thread docs/docs/Develop/integrations-langfuse.mdx
Comment thread docs/docs/Develop/integrations-langfuse.mdx Outdated
Copy link
Copy Markdown
Collaborator

@aimurphy aimurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving docs changes with one comment

Comment thread docs/docs/Develop/integrations-langfuse.mdx Outdated
@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Mar 11, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Mar 13, 2026
@github-actions

This comment has been minimized.

@mendonk mendonk added this pull request to the merge queue Mar 13, 2026
@mendonk mendonk removed this pull request from the merge queue due to a manual request Mar 13, 2026
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Mar 13, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Mar 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 13, 2026

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@mendonk mendonk enabled auto-merge March 13, 2026 19:51
@mendonk mendonk added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 1dafc75 Mar 13, 2026
99 of 101 checks passed
@mendonk mendonk deleted the fix-langfuse-hose-and-base-url-mismatch branch March 13, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants