Skip to content

feat(langchain): langfuse trace attributes in run invocation config #1213

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 3 commits into from
Jun 16, 2025

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jun 15, 2025

Important

Modified metadata handling in CallbackHandler.py to retain session/user keys for better tracking and marked a test as flaky in test_openai.py.

  • Metadata Handling:
    • Modified _strip_langfuse_keys_from_dict in CallbackHandler.py to retain langfuse_session_id and langfuse_user_id keys.
    • Enhances cross-session user activity tracking and request correlation.
    • Aligns with OpenTelemetry trace attributes for better observability.
  • Testing:
    • Marked test_response_api_image_input in test_openai.py as flaky and skipped.

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


Greptile Summary

Disclaimer: Experimental PR review

Modified metadata handling in LangChain callback handler to preserve session and user tracking information for improved request tracing.

  • Changed _strip_langfuse_keys_from_dict in langfuse/langchain/CallbackHandler.py to retain langfuse_session_id and langfuse_user_id keys in metadata
  • Enhancement enables better cross-session user activity tracking and request correlation
  • Aligns with OpenTelemetry trace attributes implementation for more comprehensive observability

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

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit 13ef221 into main Jun 16, 2025
10 checks passed
@hassiebp hassiebp deleted the feat-otel-trace-attributes-metadata branch June 16, 2025 11:52
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