Skip to content

Conversation

@narsaynorath
Copy link
Member

@narsaynorath narsaynorath commented Dec 8, 2025

This begins adding the traceMetrics dataset to Dashboards. This is still a WIP and different aspects of Metrics in dashboards still need iteration before being feature complete and releasable.

The functionality captured here are:

  • The dataset button appears
  • When selecting the dataset, the visualize bars load the first metric and selects it, as well as auto-selects the first applicable aggregate
  • Users can add more metrics to compare
  • Users can filter metrics
  • Users can add a group by
  • Users can save and edit a widget

The functionality that needs to be iterated on (i.e. not complete in this PR) are:

  • Decide how to restrict when users can query different metrics (e.g. filters across different metrics can't be applied the same way we do other datasets)
  • Group by should be restricted to the metrics selected
  • Order by should be automatically selected and set to the aggregate
  • Adding an alias needs to work
  • Handle starting state/empty state better before we've loaded metrics
  • Fix bug with new timeseries visualization
  • Implement confidence footer

@narsaynorath narsaynorath requested review from a team as code owners December 8, 2025 16:35
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 8, 2025
@narsaynorath narsaynorath marked this pull request as draft December 8, 2025 16:39
} as QueryFieldValue)
: axis
) ?? [],
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Undefined aggregate set when metric type unknown

When a metric has an unknown type not present in OPTIONS_BY_TYPE, the aggregateOptions array is empty. The useEffect at line 47 sets validAggregate = aggregateOptions[0]?.value, which evaluates to undefined for an empty array. This results in dispatching a function array with undefined as the aggregate name: [undefined, 'value', undefined, undefined]. When converted to a widget query string, this produces an invalid aggregate like undefined(value,...) that would cause backend errors or incorrect widget behavior.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

For now we can assume the metric type exists and is compatible. We can follow up in a future PR about what to do when the type isn't compatible.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #104518      +/-   ##
===========================================
- Coverage   80.51%    80.51%   -0.01%     
===========================================
  Files        9347      9347              
  Lines      399873    399835      -38     
  Branches    25651     25640      -11     
===========================================
- Hits       321962    321931      -31     
+ Misses      77463     77456       -7     
  Partials      448       448              

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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