Skip to content

fix(client): use tracing_enabled in get_client #1220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2025

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jun 23, 2025

Important

Fixes tracing_enabled propagation in Langfuse client initialization to ensure consistent tracing behavior across instances.

  • Behavior:
    • Fixes propagation of tracing_enabled in get_client() in get_client.py to ensure consistent tracing across client instances.
    • Adds tracing_enabled as an instance variable in _initialize_instance() in resource_manager.py.
  • Code Quality:
    • Improves readability with multi-line formatting for tracing_enabled assignment in resource_manager.py.
  • Tests:
    • Updates test_create_generation() in test_core_sdk.py to correct JSON string formatting.

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


Greptile Summary

Disclaimer: Experimental PR review

Fixes bug in client initialization where tracing_enabled flag wasn't properly propagated when creating new Langfuse client instances via get_client(). This ensures consistent tracing behavior across multiple clients.

  • Fixed propagation of tracing_enabled setting in langfuse/_client/get_client.py to maintain state across client instances
  • Added tracing_enabled as instance variable in langfuse/_client/resource_manager.py's _initialize_instance method
  • Improved code readability with multi-line formatting for tracing_enabled conditional assignment

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

2 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit 7ff5385 into main Jun 23, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-5416-fix-tracing-enabled-decorator branch June 23, 2025 13:58
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: Python SDK v3 fails when tracing is disabled
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy