feat(tracemetrics): Add equation support in old tracemetric alerts#113665
Conversation
Only adds the equation builder to old tracemetrics alerts
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 89f37ac. Configure here.
| return <MetricsEquationVisualize />; | ||
| return ( | ||
| <MetricsEquationVisualize | ||
| projectIds={projectId ? [Number(projectId)] : undefined} |
There was a problem hiding this comment.
Inconsistent projectIds fallback: undefined vs empty array
Medium Severity
The refactoring changed the projectIds fallback in the detector form path from [] (empty array, the prior behavior inside MetricToolbar) to undefined. The new legacy alert path in metricsEquationVisualizeField.tsx correctly uses [] as the fallback, matching the original behavior. This inconsistency means the MetricSelector in the detector form receives undefined instead of [] when no project is selected, which can change query behavior (e.g., fetching metrics for all projects rather than none).
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 89f37ac. Configure here.
There was a problem hiding this comment.
This is fine for now, I can follow up in another PR to tighten up what the proper filter should be in this case. Since project selection is important for setting alerts I don't expect this to be common, only on init maybe but even then, I should just disable the request if we don't have a project where we expect one.


Only adds the equation builder to old tracemetrics alerts
Best viewed with whitespace changes off since some component structures were indented to allow for the feature flag branch