bug: hardcoded legendFormat carried into Explore causes duplicate series names
#1,248 opened on May 12, 2026
Repository metrics
- Stars
- (27 stars)
- PR merge metrics
- (PR metrics pending)
Description
What happens
Opening a metric panel in Explore from Drilldown carries over a hardcoded legend. The series end up looking wrong or confusing (e.g. multiple series sharing the same name after a query edit), and the legend setting is collapsed by default in Explore so he user has no clear way to understand why or fix it.
Where the legendFormat is set
src/shared/GmdVizPanel/types/timeseries/getTimeseriesQueryRunnerParams.tssrc/shared/GmdVizPanel/types/stat/getStatQueryRunnerParams.tssrc/shared/GmdVizPanel/types/percentiles/getPercentilesQueryRunnerParams.tssrc/shared/GmdVizPanel/types/statushistory/getStatushistoryQueryRunnerParams.ts
Where the link is built
src/MetricScene/PanelMenu/actions/ExploreAction.ts calls
getExploreURL(panelData, ..., (query) => ...). The current transform
callback only strips __ignore_usage__ from expr.
Proposed fix
Strip legendFormat in the ExploreAction transform callback so the Explore
URL does not carry Drilldown's hardcoded legend, while leaving Drilldown's
own panels untouched.
Repro
- Open a metric in Drilldown (no group-by).
- Panel menu → Explore.
- In Explore, edit the query to add
by (some_label). - Observe all series in the legend share the same name (e.g.
avg). - Expand
Options → Legendand clear the field — series names now render correctly from labels.