Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Aug 5, 2025

Important

Make LANGFUSE_DEBUG and LANGFUSE_TRACING_ENABLED environment variable parsing case-insensitive in langfuse/_client/client.py.

  • Behavior:
    • Modify langfuse/_client/client.py to parse LANGFUSE_DEBUG and LANGFUSE_TRACING_ENABLED environment variables case-insensitively.
    • Default values changed to lowercase "true"/"false" for consistency.
    • LANGFUSE_DEBUG accepts "True", "TRUE", "true" and compares against "true".
    • LANGFUSE_TRACING_ENABLED uses "false" for exclusion check.
  • Testing:
    • Ensure tests in tests/test_otel.py validate the changes without breaking existing functionality.

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


Disclaimer: Experimental PR review

Greptile Summary

This PR improves the environment variable parsing for the Langfuse Python SDK by making boolean environment variables case-insensitive. The change affects two key configuration variables: LANGFUSE_DEBUG and LANGFUSE_TRACING_ENABLED.

What Changed:

  • Modified the parsing logic in langfuse/_client/client.py to convert environment variable values to lowercase before comparison
  • Changed the default values from "True"/"False" to "true"/"false" for consistency
  • The LANGFUSE_DEBUG variable now accepts any case variation (e.g., "True", "TRUE", "true") and compares against "true"
  • The LANGFUSE_TRACING_ENABLED variable now uses "false" as the exclusion check, making it more intuitive

How it Integrates:
This change enhances the client initialization process in the core Langfuse client class. The environment variable parsing happens during client instantiation and affects the SDK's debug logging behavior and tracing functionality. The modification maintains full backward compatibility while making the configuration more user-friendly, aligning with common practices for boolean environment variables in Python applications.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it improves user experience while maintaining backward compatibility
  • Score reflects a straightforward improvement to environment variable parsing with clear benefits and no breaking changes
  • Pay close attention to the client initialization logic to ensure the new parsing works correctly across different case variations

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.

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@hassiebp hassiebp merged commit f84a7b6 into main Aug 5, 2025
10 checks passed
@hassiebp hassiebp deleted the fix-tracing-env-parse branch August 5, 2025 11:27
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: LANGFUSE_TRACING_ENABLED need to be "False" to disable tracing but docs say "false" instead

2 participants