fix(explore): Reduce repeated trace metric requests#113660
Merged
nsdeschenes merged 6 commits intomasterfrom Apr 23, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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>
nikkikapadia
approved these changes
Apr 22, 2026
narsaynorath
approved these changes
Apr 22, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
startandendto a relativestatsPeriodStartandstatsPeriodEnd, so that we can actually properly cache those requests.The branch also threads an optional
staleTimethrough 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