Skip to content

feat(explore): Validate spans search attributes#118015

Open
nsdeschenes wants to merge 13 commits into
masterfrom
nd/EXP-1008/feat-explore-validate-query-builder
Open

feat(explore): Validate spans search attributes#118015
nsdeschenes wants to merge 13 commits into
masterfrom
nd/EXP-1008/feat-explore-validate-query-builder

Conversation

@nsdeschenes

Copy link
Copy Markdown
Contributor

The spans tab now validates the active search query through the events validation endpoint and feeds the result back into the search query builder. Valid dynamic attributes discovered by validation are added to the local filter key set, while invalid validated keys are highlighted as warnings in the query builder.

The shared async filter-key registry setup now lives in a hook so trace item builders and the generic search query builder provider use the same cache behavior. Tests cover the validation query options, hook error handling, and propagation of valid and invalid keys through the builder props.

Refs EXP-1008

nsdeschenes and others added 2 commits June 18, 2026 11:12
Fetch validation results for the spans tab search query and use them to keep known valid dynamic attributes searchable while warning on invalid keys.

Extract the filter key registry setup so trace item builders and the provider share the same metadata cache.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Add coverage for spans search validation query options, request handling, and propagation of valid and invalid validation keys through the search query builder.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@linear-code

linear-code Bot commented Jun 18, 2026

Copy link
Copy Markdown

EXP-1008

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 18, 2026
nsdeschenes and others added 3 commits June 19, 2026 09:50
…/feat-explore-validate-query-builder

# Conflicts:
#	static/app/components/performance/spanSearchQueryBuilder.tsx
#	static/app/views/explore/spans/spansTabSearchSection.spec.tsx
#	static/app/views/explore/spans/spansTabSearchSection.tsx
Update the frontend validation schema to mirror the nested query response from the validate endpoint. Read validated query fields from the nested fields array so custom span query attributes continue to populate search suggestions.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Remove the unsupported-filter override from trace item search builder props. Keep dynamic tag key suggestions available without forcing unsupported filters to be rejected.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Comment thread static/app/views/explore/components/traceItemSearchQueryBuilder.tsx
nsdeschenes and others added 4 commits June 19, 2026 13:15
Restore the trace item query builder override so unsupported filters are disallowed when async tag keys are unavailable. Keep the test coverage that asserts async key support allows unsupported filters.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Pass invalidFilterKeys into query parsing and annotate matching filter tokens with the same invalid state used for unsupported keys. Add parser coverage so invalid keys make the query invalid.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Render invalidFilterKeys with the invalid token state instead of warning state so their visual treatment matches invalid parsed filters.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Match aggregate filter keys with their arguments when applying validation results so invalid function filters are marked invalid in the query builder.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@nsdeschenes

Copy link
Copy Markdown
Contributor Author

@sentry review

@nsdeschenes

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread static/app/views/explore/spans/spansTabSearchSection.tsx
Comment thread static/app/components/searchQueryBuilder/utils.tsx
Keep previous span validation results while a new validate request is loading so invalid filter highlighting does not briefly disappear between query keys.

Parse validation error responses in the shared query options so invalid validation details are cached as data and can be reused as placeholder data.

Co-Authored-By: OpenAI Codex <noreply@example.com>
@nsdeschenes

Copy link
Copy Markdown
Contributor Author

@cursor review

@nsdeschenes

Copy link
Copy Markdown
Contributor Author

@sentry review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit aa07043. Configure here.

Keep the validation schema private since only the inferred data type is used outside the module.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@nsdeschenes nsdeschenes marked this pull request as ready for review June 19, 2026 17:49
@nsdeschenes nsdeschenes requested a review from a team as a code owner June 19, 2026 17:49
@nsdeschenes nsdeschenes requested a review from a team as a code owner June 19, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant