chore(client): move to LANGFUSE_BASE_URL #1418
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
Renamed
hosttobase_urlin Langfuse client, addedLANGFUSE_BASE_URLenv variable, and ensured backward compatibility withLANGFUSE_HOST.hostparameter tobase_urlinLangfuse.__init__()with backward compatibility.LANGFUSE_BASE_URLenvironment variable, deprecatedLANGFUSE_HOST.base_urlarg →LANGFUSE_BASE_URLenv →hostarg →LANGFUSE_HOSTenv → default.Langfuseclient initialization and internal references fromself._hosttoself._base_urlinclient.py.LangfuseSpanProcessorandLangfuseResourceManagerto usebase_url.get_client.pyto usebase_url.test_additional_headers_simple.pyandtest_initialization.pyto reflectbase_urlchanges.base_urlprecedence and backward compatibility intest_initialization.py.This description was created by
for fc5f2ec. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Updated On: 2025-10-22 12:33:06 UTC
Summary
Renamed the
hostparameter tobase_urlacross the Langfuse client codebase to improve API consistency and clarity.Key changes:
LANGFUSE_BASE_URLenvironment variable withLANGFUSE_HOSTmarked as deprecatedLangfuse.__init__()to acceptbase_urlparameter with full backward compatibility forhostbase_urlarg →LANGFUSE_BASE_URLenv →hostarg →LANGFUSE_HOSTenv → default valueself._hosttoself._base_urlthroughout the clientLangfuseResourceManager,LangfuseSpanProcessor, etc.) to usebase_urlbase_urlparameter while maintaining existing test coverageBackward compatibility:
hostparameter is preserved in the API signaturehostparameter orLANGFUSE_HOSTenvironment variable will continue to workConfidence Score: 5/5
Important Files Changed
File Analysis
LANGFUSE_BASE_URLenvironment variable and markedLANGFUSE_HOSTas deprecated with clear documentationhostparameter tobase_urlwith backward compatibility fallback, updated all internal references fromself._hosttoself._base_urlhostparameter tobase_urlthroughout the resource manager, updated all method signatures and internal referenceshostparameter tobase_urlin span processor initialization and endpoint constructionbase_urlinstead ofhostwhen creating clients from resource manager instancesbase_urlparameter inLangfuseSpanProcessorinitialization, maintaining test coverageSequence Diagram
sequenceDiagram participant User participant Langfuse participant ResourceManager participant SpanProcessor participant API User->>Langfuse: __init__(base_url="...", host="...") Note over Langfuse: Priority: base_url > LANGFUSE_BASE_URL env > host > LANGFUSE_HOST env Langfuse->>Langfuse: self._base_url = resolved value Langfuse->>ResourceManager: __new__(base_url=self._base_url) ResourceManager->>ResourceManager: Store base_url ResourceManager->>SpanProcessor: __init__(base_url=base_url) SpanProcessor->>SpanProcessor: endpoint = f"{base_url}/api/public/otel/v1/traces" SpanProcessor->>API: Configure OTLP exporter with endpoint ResourceManager->>API: Create FernLangfuse(base_url=base_url) ResourceManager->>API: Create AsyncFernLangfuse(base_url=base_url) ResourceManager->>API: Create LangfuseClient(base_url=base_url)