Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(environments): correctly propagate client attribute #1188

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 1 commit into from
May 22, 2025

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented May 21, 2025

Important

Add environment attribute propagation to span and generation methods in client.py and span.py.

  • Behavior:
    • Add environment attribute propagation in start_span(), start_as_current_span(), _start_as_current_otel_span_with_processed_media(), update_current_span(), and update_current_trace() in client.py.
    • Add environment attribute to LangfuseSpan and LangfuseGeneration constructors in span.py.
  • Classes:
    • LangfuseSpan and LangfuseGeneration now include environment in their initialization and attribute setting.
  • Misc:
    • Update docstrings in span.py to include environment parameter.

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

Greptile Summary

Disclaimer: Experimental PR review

This PR fixes environment attribute propagation in the Langfuse Python client by ensuring proper environment context handling throughout the tracing system.

  • Added environment parameter to LangfuseSpanWrapper constructor in langfuse/_client/span.py to initialize environment context
  • Modified span creation methods in langfuse/_client/client.py to pass environment attribute to child spans
  • Added environment attribute setting in LangfuseSpanWrapper when provided to ensure proper tracking
  • Ensured environment propagation through all span hierarchy methods for consistent tracing

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 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit d2e7e2d into main May 22, 2025
8 of 10 checks passed
@hassiebp hassiebp deleted the fix-v3-environments branch May 22, 2025 08:23
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.