Skip to content

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

2 participants