feat(alerts): Add trace metrics support to new alert UI (detectors) #108730
Merged
feat(alerts): Add trace metrics support to new alert UI (detectors) #108730
Conversation
Adds 'trace metrics' (another EAP data type) to alerts for the new alerts UI. Should be behind the tracemetrics-enabled UI flag since not all customers have access to tracemetrics as it's currently in open beta.
Co-authored-by: Cursor <[email protected]>
static/app/views/detectors/components/forms/metric/metricTemplateOptions.tsx
Show resolved
Hide resolved
static/app/views/detectors/components/forms/metric/metricsVisualize.tsx
Outdated
Show resolved
Hide resolved
… template format Co-authored-by: Cursor <[email protected]>
static/app/views/detectors/datasetConfig/components/metricsSearchBar.tsx
Show resolved
Hide resolved
scttcper
approved these changes
Feb 24, 2026
…Metrics URL Made-with: Cursor
…gate, remove auto-select, add empty tooltip Made-with: Cursor
…hable/onSearch Made-with: Cursor
…hind feature flag Made-with: Cursor
Made-with: Cursor
…rics dataset template Made-with: Cursor
static/app/views/detectors/datasetConfig/components/metricsSearchBar.tsx
Show resolved
Hide resolved
… project The three useTraceItemAttributeKeys calls were falling back to usePageFilters().selection.projects instead of using the projectIds from the detector form. Added projectIds to the hook interface and passed it from MetricsDetectorSearchBar. Made-with: Cursor
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.
| width: 100%; | ||
| font-weight: normal; | ||
| } | ||
| `; |
Contributor
There was a problem hiding this comment.
Duplicate styled component across sibling form files
Low Severity
The newly added StyledSelect in metricsVisualize.tsx is a styled(CompactSelect) with CSS identical to both StyledAggregateSelect and StyledVisualizeSelect in the sibling file visualize.tsx. All three apply the same width, max-width, and button styles. This triplication across two closely related files increases maintenance burden — a shared styled component could be extracted and imported by both files.
Additional Locations (1)
Triggered by project rule: Frontend guidelines
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.


Summary
Adds 'trace metrics' (another EAP data type) to alerts for the new alerts UI. Should be behind the tracemetrics-enabled UI flag since not all customers have access to tracemetrics as it's currently in open beta.
This will be also behind the tracemetrics-alerts UI flag which will be internal only until we're sure we like the flow, copy etc.
Notes:
MetricsVisualize: Unlike other datasets, metrics has additional selectors, specifically it has a 'metric name' selector and an operation selector (which is a set of allowed operations based on the metric type)MetricsDetectorSearchBar: Metrics also makes use of co-occuring keys from EAP, so based on selecting a metric name we can exclude the majority of attributes that aren't set for that metric in your filter results.Screenshot