Skip to content

feat(alerts): Add trace metrics support to new alert UI (detectors) #108730

Merged
k-fish merged 12 commits intomasterfrom
fix/metrics/new-alerts
Mar 2, 2026
Merged

feat(alerts): Add trace metrics support to new alert UI (detectors) #108730
k-fish merged 12 commits intomasterfrom
fix/metrics/new-alerts

Conversation

@k-fish
Copy link
Copy Markdown
Member

@k-fish k-fish commented Feb 20, 2026

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:

  • We're autoselecting the first metric here like the other metrics forms but it does cause a flash of content, I might remove it and have the custom metrics form empty to start.
  • 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.
  • Finally there is a lot of use of the word 'metric' here, we may look into changing it after we merge this and before we bring this out of internal.

Screenshot

Screenshot 2026-02-20 at 3 14 29 PM

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.
@k-fish k-fish requested a review from a team February 20, 2026 20:20
@k-fish k-fish requested a review from a team as a code owner February 20, 2026 20:20
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 20, 2026
k-fish added 2 commits March 2, 2026 12:11
… 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
@k-fish k-fish merged commit 61a4476 into master Mar 2, 2026
60 checks passed
@k-fish k-fish deleted the fix/metrics/new-alerts branch March 2, 2026 20:37
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.

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

width: 100%;
font-weight: normal;
}
`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

Triggered by project rule: Frontend guidelines

@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants