Skip to content

Commit

Permalink
feat(server): add endpoint to search spans in a trace (#3611)
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren committed Feb 8, 2024
1 parent 810b698 commit 3bfdbab
Show file tree
Hide file tree
Showing 16 changed files with 589 additions and 11 deletions.
28 changes: 28 additions & 0 deletions api/openapi.yaml
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
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
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
116 changes: 116 additions & 0 deletions 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.

0 comments on commit 3bfdbab

Please sign in to comment.