-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(tracemetrics): Disable Save As for equations #113089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,24 +111,37 @@ export function useSaveAsMetricItems(_options: UseSaveAsMetricItemsOptions) { | |
| label: t('All Metrics'), | ||
| textValue: t('All Metrics'), | ||
| onAction: () => { | ||
| addToDashboard(metricQueries); | ||
| addToDashboard( | ||
| metricQueries.filter( | ||
| metricQuery => | ||
| !isVisualizeEquation(metricQuery.queryParams.visualizes[0]!) | ||
| ) | ||
| ); | ||
| }, | ||
| }, | ||
| ] | ||
| : []), | ||
| ...metricQueries.map((metricQuery, index) => { | ||
| const visualize = metricQuery.queryParams.visualizes[0]!; | ||
| return { | ||
| key: `add-to-dashboard-${index}`, | ||
| label: `${metricQuery.label ?? getVisualizeLabel(index, isVisualizeEquation(metricQuery.queryParams.visualizes[0]!))}: ${ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "All Metrics" silently no-ops when all queries are equationsMedium Severity The "All Metrics" submenu option appears whenever Additional Locations (1)Reviewed by Cursor Bugbot for commit 542cd44. Configure here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not an issue. You can't remove the last metric. |
||
| label: `${metricQuery.label ?? getVisualizeLabel(index, isVisualizeEquation(visualize))}: ${ | ||
| formatTraceMetricsFunction( | ||
| metricQuery.queryParams.aggregateFields | ||
| .filter(isVisualize) | ||
| .map(v => v.yAxis) | ||
| ) as string | ||
| }`, | ||
| onAction: () => { | ||
| if (isVisualizeEquation(visualize)) { | ||
| return; | ||
| } | ||
| addToDashboard(metricQuery); | ||
| }, | ||
| disabled: isVisualizeEquation(visualize), | ||
| tooltip: isVisualizeEquation(visualize) | ||
| ? t('Equations cannot currently be added to a dashboard') | ||
| : undefined, | ||
| }; | ||
| }), | ||
| ], | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.