Skip to content

feat(attributes): Add batch attribute validation endpoint for trace items - Round 2#110647

Merged
nsdeschenes merged 5 commits intomasterfrom
nd/EXP-640/feat-attributes-add-in-validation-api
Mar 16, 2026
Merged

feat(attributes): Add batch attribute validation endpoint for trace items - Round 2#110647
nsdeschenes merged 5 commits intomasterfrom
nd/EXP-640/feat-attributes-add-in-validation-api

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

Adds a new POST endpoint at /api/0/organizations/{org}/trace-items/attributes/validate/ that accepts a list of attribute names and an item type, then returns per-attribute validity and type information.

This enables pre-flight validation for callers that need to check whether a set of attribute names are valid before using them in queries, without having to look them up one-by-one or list all attributes.

The endpoint uses the existing SearchResolver.resolve_attribute() for validation and constants.TYPE_MAP to coarsen internal search types into "string", "number", or "boolean". Request body is capped at 100 attributes.

nsdeschenes and others added 5 commits March 13, 2026 07:40
Adds POST /api/0/organizations/{org}/trace-items/attributes/validate/
that accepts a list of attribute names and returns per-attribute validity
and type, enabling pre-flight validation for callers.
Covers feature flag gating, request validation, well-known attributes,
virtual context attributes, typed and untyped user tags, invalid
attributes, and mixed valid/invalid batches.
Return a 400 instead of an unhandled 500 when an item type that is
valid in the enum but not yet supported by get_column_definitions
(e.g. uptime_results, profile_functions) is passed to the validate
endpoint.
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 13, 2026

@nsdeschenes nsdeschenes marked this pull request as ready for review March 13, 2026 16:49
@nsdeschenes nsdeschenes requested review from a team as code owners March 13, 2026 16:49
@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Mar 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Copy link
Copy Markdown
Member

@wmak wmak left a comment

Choose a reason for hiding this comment

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

still lgtm

@nsdeschenes nsdeschenes merged commit 81c19cc into master Mar 16, 2026
138 of 143 checks passed
@nsdeschenes nsdeschenes deleted the nd/EXP-640/feat-attributes-add-in-validation-api branch March 16, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants