fix: add project_id to urls returned by langfuse_context.get_current_trace_url#1056
fix: add project_id to urls returned by langfuse_context.get_current_trace_url#1056marcklingen merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Disclaimer: Experimental PR review
PR Summary
Updates the trace URL generation in the Python SDK to include project ID in the path, providing more context-rich URLs for better trace navigation and identification.
- Modified
get_current_trace_urlin/langfuse/decorators/langfuse_decorator.pyto support/project/{project_id}/traces/{trace_id}format - Added
_get_project_id()method in/langfuse/client.pywith caching for efficient project ID retrieval - Added test coverage in
/tests/test_decorators.pyand/tests/test_core_sdk.pyto verify URL formatting with project IDs - Maintained backward compatibility by falling back to
/trace/{trace_id}when project ID is unavailable
💡 (3/5) Reply to the bot's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!
4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Disclaimer: Experimental PR review
PR Summary
No significant changes found since the last review. The previous review comprehensively covered all major modifications related to adding project IDs to trace URLs, including the implementation details and test coverage.
4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Disclaimer: Experimental PR review
PR Summary
(updates since last review)
No significant changes found since the last reviews. The previous reviews comprehensively covered the addition of project IDs to trace URLs and associated test coverage.
4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
|
@hassiebp fyi, tests fully covered this change |
Important
Add
project_idto trace URLs inLangfuseandlangfuse_contextto ensure correct project context in Langfuse UI.project_idto URLs inLangfuse.get_trace_url()andlangfuse_context.get_current_trace_url()._get_project_id()inLangfuseto fetch and cache project ID.test_get_project_id()intest_core_sdk.pyto verify project ID retrieval.test_get_current_trace_url()intest_decorators.pyto check URL format with project ID.This description was created by
for 0dae388. It will automatically update as commits are pushed.