-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat: phoenix client get_spans_dataframe()
and query_spans()
#2151
Conversation
get_spans_dataframe()
and query_spans()
src/phoenix/server/query_handlers.py
Outdated
@@ -0,0 +1,127 @@ | |||
import asyncio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, these files are many times nested under routes
in traditional REST https://github.com/Arize-ai/openinference/blob/main/python/examples/llama-index/backend/app/api/routers/chat.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks for the tip.
src/phoenix/server/query_handlers.py
Outdated
) | ||
|
||
|
||
class QuerySpansHandler(HTTPEndpoint): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you consolidate these two? It seems like they could be just /v1/spans?format=xyz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give it some thought. But probably will do this in a follow-up PR for refactoring
src/phoenix/server/query_handlers.py
Outdated
traces: Traces | ||
evals: Optional[Evals] = None | ||
|
||
async def post(self, request: Request) -> Response: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking but POST is not the most standard for REST. Getting something is usually "GET" - I know we use graphql which breaks that convention but it might make sense to stick with conventions in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. In the interest of time, i'll get this deployed first. Then I'll enumerate all the refactoring tasks in a follow-up PR, because I need time to understand them better myself, but those changes don't impact the user.
src/phoenix/session/client.py
Outdated
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Client: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need a shared protocol with Session so this can be say this complies with all the session.evaluation helpers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea.
resolves #2091
resolves #2136
resolves #2137
Screenshot shows the client in a console returning dataframes from Phoenix running in the background.