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

feat(server): add endpoint to search spans in a trace #3611

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,34 @@ paths:
application/json:
schema:
$ref: "tests.yaml#/components/schemas/ExportedTestInformation"

/tests/{testId}/run/{runId}/search-spans:
post:
tags:
- api
parameters:
- $ref: "./parameters.yaml#/components/parameters/testId"
- $ref: "./parameters.yaml#/components/parameters/runId"
summary: get spans fileter by query
description: get spans fileter by query
operationId: searchSpans
requestBody:
content:
application/json:
schema:
type: object
properties:
query:
type: string
description: query to filter spans, can be either a full text search or a Span Query Language query
responses:
200:
description: trace containing matching spans only
content:
application/json:
schema:
$ref: "tests.yaml#/components/schemas/SearchSpansResult"

/tests/import:
post:
tags:
Expand Down
8 changes: 8 additions & 0 deletions api/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,14 @@ components:
items:
type: string

SearchSpansResult:
type: object
properties:
spansIds:
type: array
items:
type: string

Selector:
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion api/trace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ components:
tree:
$ref: "#/components/schemas/Span"
flat:
description: falttened version, mapped as spanId -> span{}
description: flattened version, mapped as spanId -> span{}
type: object
additionalProperties:
$ref: "#/components/schemas/Span"
Expand Down
118 changes: 117 additions & 1 deletion cli/openapi/api_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

125 changes: 125 additions & 0 deletions cli/openapi/model_search_spans_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.