Skip to content

fix(client): scope mask function to resources singleton #1210

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 8 commits into from
Jun 11, 2025

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jun 10, 2025

Important

Refactors Langfuse client to centralize mask function management in LangfuseResourceManager for consistent span handling.

  • Behavior:
    • Moves mask function from Langfuse client class to LangfuseResourceManager singleton for centralized management.
    • Adds new mask parameter (type: MaskFunction) to LangfuseResourceManager class for resource-level control.
    • Ensures consistent masking behavior across all spans using the same public key.
    • Prevents potential inconsistencies by sharing mask function through resource manager singleton.
  • Code Changes:
    • Updates Langfuse class in client.py to use LangfuseResourceManager for mask function.
    • Modifies LangfuseSpanWrapper in span.py to utilize the centralized mask function.
    • Adjusts tests in test_core_sdk.py and test_otel.py to reflect changes in mask function handling.

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


Greptile Summary

Disclaimer: Experimental PR review

Refactors the masking functionality in the Python client by moving mask function management from Langfuse class to LangfuseResourceManager singleton for better resource handling and consistency.

  • Moves mask function from Langfuse client class to LangfuseResourceManager singleton for centralized management
  • Adds new mask parameter (type: MaskFunction) to LangfuseResourceManager class for resource-level control
  • Ensures consistent masking behavior across all spans using the same public key
  • Prevents potential inconsistencies by sharing mask function through resource manager singleton

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 changed the title fix(masking): scope mask function to resources singleton fix(client): scope mask function to resources singleton Jun 10, 2025
@hassiebp hassiebp merged commit 51a9102 into main Jun 11, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-5241-fix-attr-to-resources branch June 11, 2025 08:31
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.

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