Repository navigation
feat: add set_langfuse_context helpers for trace metadata - #3893
chakshu-dhannawat wants to merge 2 commits into
Conversation
Adds convenience functions to set/reset Langfuse trace-level context (user_id, session_id, tags, version, trace_id) without manually touching the context variable. This makes the existing tracing_context_var behavior discoverable and easier to use. Closes deepset-ai#1279
|
Hi @chakshu-dhannawat, thanks for your interest in contributing to Haystack! 🙏 This is an automated message to help us keep the review queue healthy. |
|
Heads-up for maintainers This PR is from a fork and touches integrations whose integration tests require API keys. Affected integrations:
Please run the integration tests locally ( |
Coverage report (langfuse)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
…et_langfuse_context Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Hi @julian-risch, gentle ping for a review when you have a moment. Thanks. |
Adds convenience helpers to set/reset Langfuse trace-level context without manually touching the internal context variable.
New exports in
haystack_integrations.tracing.langfuse:set_langfuse_context(trace_id, user_id, session_id, tags, version)reset_langfuse_context(token)LangfuseContextTokenThese wrap the existing
tracing_context_varplumbing thatLangfuseTraceralready reads when creating a root trace. They make it easier to attachuser_id,session_id,tags,version, andtrace_idto the next pipeline run, as discussed in #1279 and #1264.Closes #1279
Relates to #1264
How did you test it?
hatch run test:unitandhatch run test:typesfor the langfuse integration.Checklist