Skip to content

feat(attributes): return last seen, cardinality, and Relay-modified counts in attribute details - #130528

Merged
JoshuaKGoldberg merged 8 commits into
masterfrom
joshgoldberg/exp-1453-return-last-seen-from-the-attribute
Nov 25, 2026
Merged

JoshuaKGoldberg merged 8 commits into
masterfrom
joshgoldberg/exp-1453-return-last-seen-from-the-attribute

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

The attribute details endpoint now returns per-dataset stats for the attribute: when it was last seen, its approximate cardinality, and for spans, how many stored spans had its value modified by Relay. Stats come back null when they can't be computed: when a query fails, when the attribute is computed rather than stored, or for cardinality of boolean and array attributes.

Closes EXP-1453. Closes EXP-1456.

@linear-code

linear-code Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

EXP-1456

EXP-1453

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 9, 2026
@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review November 10, 2026 14:59
@JoshuaKGoldberg
JoshuaKGoldberg requested review from a team as code owners November 10, 2026 14:59
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the joshgoldberg/exp-1453-return-last-seen-from-the-attribute branch from 001793d to 9746482 Compare November 10, 2026 20:41
@sentry

sentry Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 1084 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the joshgoldberg/exp-1453-return-last-seen-from-the-attribute branch from 9746482 to 1bc6198 Compare November 10, 2026 21:02
Base automatically changed from joshgoldberg/exp-1452-show-units-on-attribute-details to master November 11, 2026 14:13
@JoshuaKGoldberg
JoshuaKGoldberg requested a review from a team as a code owner November 11, 2026 14:13
@JoshuaKGoldberg
JoshuaKGoldberg removed the request for review from a team November 11, 2026 14:20
@JoshuaKGoldberg
JoshuaKGoldberg removed this pull request from stack #130617 November 11, 2026 17:15
@JoshuaKGoldberg
JoshuaKGoldberg removed this pull request from stack #130799 November 11, 2026 18:04

@nikkikapadia nikkikapadia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm! one question but i also think it's worth getting @mjq eyes on this because i don't know too much about how these things are stored in EAP and such

rows = [attribute for attribute in response.attributes if attribute.name == ref.name]
if not rows:
if len(response.attributes) >= limit:
return _query_last_seen_from_table(dataset, refs, resolver)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

more out of curiosity, how's the table query different from the RPC query?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As I understand it (😬), they're two different Snuba queries:

  • The names RPC reads the co-occurring attributes rollup, which keeps a last_seen per weekly bucket. So it's cheap.
  • The table query scans the actual spans/logs/metrics for the newest one that has the attribute, which is exact but way more expensive.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah ok gotcha! so we do the cheap query and if we don't find anything we do the more expensive query. Makes sense to me 😌

@JoshuaKGoldberg
JoshuaKGoldberg requested a review from mjq November 24, 2026 14:22
JoshuaKGoldberg and others added 4 commits November 24, 2026 10:03
…ails endpoint

Co-Authored-By: Claude <noreply@anthropic.com>
…s by type

Co-Authored-By: Claude <noreply@anthropic.com>
…attribute details endpoint

Co-Authored-By: Claude <noreply@anthropic.com>
…d number meta keys

Co-Authored-By: Claude <noreply@anthropic.com>
@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as draft November 24, 2026 17:35
Stats now resolve each listed attribute key the way search does, plus the legacy names
that the temporary alias mappings still list, instead of collecting stored names through a
side channel while serializing the attribute list. The query module moves to
sentry.search.eap. Cardinality runs on the resolved key, so an alias stored under two names
now gets one.

Refs EXP-1453
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the joshgoldberg/exp-1453-return-last-seen-from-the-attribute branch from c399905 to ef3476c Compare November 24, 2026 17:54
@JoshuaKGoldberg JoshuaKGoldberg changed the title feat(attributes): return last seen, cardinality, and Relay-modified counts from attribute details endpoint feat(attributes): return last seen, cardinality, and Relay-modified counts in attribute details Nov 24, 2026
@JoshuaKGoldberg
JoshuaKGoldberg merged commit cb707a2 into master Nov 25, 2026
107 checks passed
@JoshuaKGoldberg
JoshuaKGoldberg deleted the joshgoldberg/exp-1453-return-last-seen-from-the-attribute branch November 25, 2026 19:33

This branch was successfully deployed

1 active deployment
Preview — 23404f87 Deployed Nov 25, 2026 by vercel[bot]
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants