feat(metrics): Enable AI searchbar on metrics explorer filter#111546
feat(metrics): Enable AI searchbar on metrics explorer filter#111546isaacwang-sentry wants to merge 1 commit intomasterfrom
Conversation
Add MetricsTabSeerComboBox component for AI-powered natural language query translation on the metrics page. Enable the AI search feature in the existing SearchQueryBuilderProvider in the metrics filter toolbar, gated behind gen-ai-features and gen-ai-search-agent-translate feature flags. The AI search applies the translated query to the per-metric filter bar, matching the pattern used by Logs and Traces. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| return ( | ||
| <AskSeerPollingComboBox<AskSeerSearchQuery> | ||
| initialQuery={initialSeerQuery} | ||
| onApplySearchQuery={applySeerSearchQuery} |
There was a problem hiding this comment.
Bug: Incorrect prop names are passed to AskSeerComboBox and AskSeerPollingComboBox, such as onApplySearchQuery instead of applySeerSearchQuery, which will break the AI search feature.
Severity: CRITICAL
Suggested Fix
In MetricsTabSeerComboBox, rename the props passed to AskSeerComboBox and AskSeerPollingComboBox to match their required interface. Specifically, change onApplySearchQuery to applySeerSearchQuery and mutationOptions to askSeerMutationOptions. Also, add the required analyticsSource and feedbackSource props to both components, referencing other implementations for appropriate values.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/views/explore/metrics/metricsTabSeerComboBox.tsx#L176
Potential issue: The `MetricsTabSeerComboBox` component passes incorrect props to its
child components. `AskSeerPollingComboBox` receives `onApplySearchQuery` instead of the
required `applySeerSearchQuery`. `AskSeerComboBox` receives `onApplySearchQuery` instead
of `applySeerSearchQuery` and `mutationOptions` instead of `askSeerMutationOptions`.
This will cause a runtime `TypeError` when a user selects an AI search suggestion
because the expected callback function `props.applySeerSearchQuery` will be undefined.
This breaks the AI search functionality. Additionally, both child components are missing
the required `analyticsSource` and `feedbackSource` props.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| initialQuery={initialSeerQuery} | ||
| onApplySearchQuery={applySeerSearchQuery} | ||
| mutationOptions={metricsTabAskSeerMutationOptions} | ||
| /> |
There was a problem hiding this comment.
Wrong prop names passed to ComboBox components
High Severity
The AskSeerComboBox component expects props named applySeerSearchQuery and askSeerMutationOptions, but this code passes onApplySearchQuery and mutationOptions instead. Similarly, AskSeerPollingComboBox expects applySeerSearchQuery but receives onApplySearchQuery. At runtime, the components will destructure undefined for the expected prop names, causing a TypeError when a user selects a query result (props.applySeerSearchQuery(item) is called on undefined). The Logs and Spans implementations correctly use applySeerSearchQuery and askSeerMutationOptions.
Additional Locations (1)
| onApplySearchQuery={applySeerSearchQuery} | ||
| mutationOptions={metricsTabAskSeerMutationOptions} | ||
| /> | ||
| ); |
There was a problem hiding this comment.
Missing required analyticsSource and feedbackSource props
Medium Severity
Both AskSeerPollingComboBox and AskSeerComboBox require analyticsSource and feedbackSource string props (used for analytics tracking and feedback form attribution), but the metrics implementation doesn't provide either. The Logs variant passes analyticsSource="logs" and feedbackSource="logs_ai_query", and Spans passes analyticsSource="trace.explorer" and feedbackSource="trace_explorer_ai_query". Without these, analytics events will fire with undefined sources and feedback forms won't have proper attribution.
| const {projects} = useProjects(); | ||
| const pageFilters = usePageFilters(); | ||
| const organization = useOrganization(); | ||
| const currentQuery = useQueryParamsQuery(); |
There was a problem hiding this comment.
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |


Summary
MetricsTabSeerComboBoxcomponent for AI-powered natural language query translation on the metrics filter barenableAISearchin the metricsSearchQueryBuilderProvider, gated behindgen-ai-featuresandgen-ai-search-agent-translatefeature flagsLogsTabSeerComboBox) and Traces (SpansTabSeerComboBox)How it works
strategy: 'Metrics'to SeeruseSetQueryParamsQuery()Dependencies
Test plan
🤖 Generated with Claude Code