Skip to content

Conversation

@narsaynorath
Copy link
Member

When groupings are applied, the current logic just concatenates the grouping names and assumes they're unique series. This does not work well when there are multiple yAxes because both yAxes can have the same labels, but they end up clobbering each other.

This detects when multiple yAxes and groupings are applied to render them in a format that more closely resembles the other datasets. i.e. <concatendated groupings> : <aggregate>

e.g. if we plotted p50(metric), and p75(metric) and grouped by platform, you would see a label like iOS : p50(...) and iOS : p75(...). I chose to use the ellipsis to format the label because we can only choose a single metric at the moment and this clears up a little UI clutter

It may be beneficial in a future PR to do the full label of the first series, just so users know the context without needing to name their widget with the metric or something.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 2, 2026
@narsaynorath narsaynorath marked this pull request as ready for review January 2, 2026 22:27
@narsaynorath narsaynorath requested a review from a team as a code owner January 2, 2026 22:27
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

This makes sense overall but I think it needs a follow-up PR where the fix is done at the TimeSeriesWidgetVisualization level (maybe I can help?)

Comment on lines +252 to +255
seriesName:
multiYAxis && hasGroupings && func
? `${formatTimeSeriesLabel(timeSeries)} : ${func.name}(…)`
: formatTimeSeriesLabel(timeSeries),
Copy link
Member

Choose a reason for hiding this comment

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

If I'm reading this right, the overlap is a bug in TimeSeriesWidgetVisualization, no? If TimeSeriesWidgetVisualization gets multiple series with different yAxis but the same groupBy, it'll mash the series together in the legend? If yes, it'd be good to fix that in TimeSeriesWidgetVisualization and then all the UIs would benefit. The caveat is that transformation functions like transformLegacySeriesToPlottables might need to be updated so we don't double-prepend the yAxis

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I agree. I can look at a follow up to generalize this more! I wanted to keep the possible blast radius of this change smaller until I received some feedback about this approach with metrics and we had some time to consider how it would be implemented for other datasets 🙏

Comment on lines 239 to 241
if (func) {
timeSeries.yAxis = `${func.name}(${func.arguments[1] ?? '…'})`;
}
Copy link
Member

Choose a reason for hiding this comment

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

Tangentially related, but this feels like maybe it can be part of formatTimeSeriesLabel?

@narsaynorath narsaynorath merged commit ced7c8c into master Jan 5, 2026
52 checks passed
@narsaynorath narsaynorath deleted the nar/fix/tracemetrics-identify-series-uniquely-with-multiple-yaxes-grouping branch January 5, 2026 18:40
cathteng pushed a commit that referenced this pull request Jan 5, 2026
When groupings are applied, the current logic just concatenates the
grouping names and assumes they're unique series. This does not work
well when there are multiple yAxes because both yAxes can have the same
labels, but they end up clobbering each other.

This detects when multiple yAxes and groupings are applied to render
them in a format that more closely resembles the other datasets. i.e.
`<concatendated groupings> : <aggregate>`

e.g. if we plotted `p50(metric)`, and `p75(metric)` and grouped by
platform, you would see a label like `iOS : p50(...)` and `iOS :
p75(...)`. I chose to use the ellipsis to format the label because we
can only choose a single metric at the moment and this clears up a
little UI clutter

It may be beneficial in a future PR to do the full label of the first
series, just so users know the context without needing to name their
widget with the metric or something.
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.

3 participants