Skip to content
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

[feature request] Add an easy way to get the root span from a child span #1052

Closed
omrihar opened this issue Oct 1, 2024 · 1 comment · Fixed by #1054
Closed

[feature request] Add an easy way to get the root span from a child span #1052

omrihar opened this issue Oct 1, 2024 · 1 comment · Fixed by #1054
Assignees
Labels
enhancement New feature or request language: python Related to Python integration

Comments

@omrihar
Copy link

omrihar commented Oct 1, 2024

Is your feature request related to a problem? Please describe.
I want to implement a feedback sending mechanism from the front-end of a chat bot to a python backend.
For LangChain, it is possible to add a link in the chain that fetches the current span_id using from openinference.instrumentation.langchain import get_current_span, but this only gives the span_id of that link.
It is much more natural to get the root span id, which is the correct one to annotate with the user-sent feedback, but it's currently not easy to accomplish programmatically. See discussion here: Arize-ai/phoenix#4800

Describe the solution you'd like
An easy to use mechanism to get the root span_id of the currently running trace, ideally in a way that is agnostic to the currently instrumented LLM framework solution, but also a specific one for each framework would be nice.

Describe alternatives you've considered
I've considered creating the root span manually and then calling a chain within that with the automatically instrumented langchain, but that is very inelegant.

@omrihar omrihar added enhancement New feature or request triage Issues that require triage labels Oct 1, 2024
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Oct 1, 2024
@dosubot dosubot bot added the language: python Related to Python integration label Oct 1, 2024
@anticorrelator
Copy link
Contributor

thank you for the request @omrihar! I'll start investigating some strategies and get back to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language: python Related to Python integration
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants