Skip to content

fix(explore): Reduce repeated trace metric requests#113660

Merged
nsdeschenes merged 6 commits intomasterfrom
nd/LOGS-723/LOGS-724/fix-tracemetrics-reduce-attributes-and-aggregate-calls
Apr 23, 2026
Merged

fix(explore): Reduce repeated trace metric requests#113660
nsdeschenes merged 6 commits intomasterfrom
nd/LOGS-723/LOGS-724/fix-tracemetrics-reduce-attributes-and-aggregate-calls

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

@nsdeschenes nsdeschenes commented Apr 22, 2026

This reuses longer-lived cache entries for trace metric attribute lookups, metric sample tables, and aggregate queries so the Explore metrics views stop re-fetching the same data when their inputs have not changed. As well, we moved to a from start and end to a relative statsPeriodStart and statsPeriodEnd, so that we can actually properly cache those requests.

The branch also threads an optional staleTime through the shared query hooks used by these views, which keeps the cache policy explicit at the call sites instead of baking trace-metric-specific behavior into the shared defaults.

Closes LOGS-723
Closes LOGS-724

nsdeschenes and others added 5 commits April 22, 2026 09:37
Simplify the hook test setup and add coverage for the relative
period window used when ingestion delay shifts the end time.

Co-Authored-By: Codex <noreply@openai.com>
Thread an optional stale time through the shared spans and trace
metric query hooks so Explore call sites can opt into longer-lived
cache entries without changing the default query behavior.

Co-Authored-By: Codex <noreply@openai.com>
Use the longer Explore cache window for trace metric attribute lookups
and metric sample tables, and keep the aggregate table cached when its
inputs are unchanged. This reduces duplicate fetches while preserving
cache invalidation through the query key.

Co-Authored-By: Codex <noreply@openai.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 22, 2026

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 22, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a34e97d. Configure here.

Keep delayed trace metric sample queries in relative-period form instead of
converting them to absolute start and end timestamps. This preserves the
intended date selection while still shifting the effective window by the
ingestion delay.

Co-Authored-By: Codex <noreply@openai.com>
@nsdeschenes nsdeschenes marked this pull request as ready for review April 22, 2026 15:52
@nsdeschenes nsdeschenes requested review from a team as code owners April 22, 2026 15:52
@nsdeschenes nsdeschenes merged commit 52162e6 into master Apr 23, 2026
65 checks passed
@nsdeschenes nsdeschenes deleted the nd/LOGS-723/LOGS-724/fix-tracemetrics-reduce-attributes-and-aggregate-calls branch April 23, 2026 09:48
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.

3 participants