Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jun 17, 2025

Important

Fixes get_client() to correctly include secret_key and host for clients in multi-project setups, preventing misconfiguration.

  • Behavior:
    • In get_client(), ensure returned Langfuse client includes secret_key and host from existing instance.
    • Addresses potential misconfiguration in multi-project setups by correctly scoping client details.
  • Logging:
    • Logs a warning if no public_key is provided in a multi-project setup, indicating tracing is disabled to prevent data leakage.

This description was created by Ellipsis for b21e2fc. You can customize this summary. It will automatically update as commits are pushed.

Greptile Summary

Disclaimer: Experimental PR review

Fixes critical client initialization issues in multi-project setups by ensuring proper propagation of host and secret_key parameters when creating new Langfuse client instances via get_client().

  • Ensures proper scoping of connection parameters (host, secret_key) in langfuse/_client/get_client.py for consistent client configuration
  • Prevents potential data routing issues by inheriting connection parameters from original instance instead of using defaults
  • Critical for scenarios where multiple projects are being monitored simultaneously

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit 990bb75 into main Jun 17, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-5333-fix-multi-project-client-init branch June 17, 2025 13:07
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.

bug: Langchain CallbackHandler fails in multi-project setting if LANGFUSE_SECRET_KEY env not set

2 participants