-
Notifications
You must be signed in to change notification settings - Fork 331
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: add default limit to /v1/spans
and corresponding client methods
#3026
Changes from all commits
41a7f58
74ad0c4
aee3701
6ef3c00
83760a0
dc02465
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,8 +50,8 @@ async def post_evaluations(request: Request) -> Response: | |
in: query | ||
schema: | ||
type: string | ||
default: default | ||
description: The project name to add the evaluation to | ||
default: default | ||
requestBody: | ||
required: true | ||
content: | ||
|
@@ -111,8 +111,8 @@ async def get_evaluations(request: Request) -> Response: | |
in: query | ||
schema: | ||
type: string | ||
default: default | ||
description: The project name to get evaluations from | ||
default: default | ||
Comment on lines
+114
to
-115
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix to OpenAPI schema |
||
responses: | ||
200: | ||
description: Success | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
from phoenix.server.api.routers.utils import df_to_bytes, from_iso_format | ||
from phoenix.trace.dsl import SpanQuery | ||
|
||
DEFAULT_SPAN_LIMIT = 1000 | ||
|
||
|
||
# TODO: Add property details to SpanQuery schema | ||
async def query_spans_handler(request: Request) -> Response: | ||
|
@@ -21,8 +23,8 @@ async def query_spans_handler(request: Request) -> Response: | |
in: query | ||
schema: | ||
type: string | ||
default: default | ||
description: The project name to get evaluations from | ||
default: default | ||
Comment on lines
+26
to
-25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix to OpenAPI schema |
||
requestBody: | ||
required: true | ||
content: | ||
|
@@ -50,11 +52,18 @@ async def query_spans_handler(request: Request) -> Response: | |
start_time: | ||
type: string | ||
format: date-time | ||
nullable: true | ||
stop_time: | ||
type: string | ||
format: date-time | ||
nullable: true | ||
limit: | ||
type: integer | ||
nullable: true | ||
axiomofjoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
default: 1000 | ||
root_spans_only: | ||
type: boolean | ||
nullable: true | ||
responses: | ||
200: | ||
description: Success | ||
|
@@ -87,6 +96,7 @@ async def query_spans_handler(request: Request) -> Response: | |
project_name=project_name, | ||
start_time=from_iso_format(payload.get("start_time")), | ||
stop_time=from_iso_format(payload.get("stop_time")), | ||
limit=payload.get("limit", DEFAULT_SPAN_LIMIT), | ||
root_spans_only=payload.get("root_spans_only"), | ||
) | ||
) | ||
|
@@ -104,9 +114,4 @@ async def content() -> AsyncIterator[bytes]: | |
|
||
|
||
async def get_spans_handler(request: Request) -> Response: | ||
""" | ||
summary: Deprecated route for querying for spans, use the POST method instead | ||
operationId: legacyQuerySpans | ||
deprecated: true | ||
""" | ||
Comment on lines
-107
to
-111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this route from the OpenAPI schema since it is being deprecated. |
||
return await query_spans_handler(request) |
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.
Fix to OpenAPI schema.