Dominik Prokop 91a0b312ed Add faceted labels filter for time series legend (#119918)
* Add faceted labels extraction and filtering utilities

- Add extractFacetedLabels to collect unique label values per key
- Add resolveFacetedFilterNames for OR-within/AND-across filtering
- Add FIELD_NAME_FACET_KEY constant for synthetic name facet
- Extend SeriesVisibilityChangeMode with SetExactly
- Widen onToggleSeriesVisibility signature to accept string[] | null

Made-with: Cursor

* Implement faceted labels filter UI and legend integration

- Add FacetedLabelsFilter component with "By name" and "By labels" sections,
  select/deselect all, expand/collapse, and dimmed state indicator
- Integrate filter into PlotLegend with popover and docked sidebar modes
- Add filterAction prop to VizLegend, VizLegendList, and VizLegendTable
- Add dismissOnScroll prop to Toggletip for scroll-aware popover dismissal
- Enable faceted filter in the TimeSeries panel
- Widen onToggleSeriesVisibility signature in PanelStateWrapper and ExploreGraph
- Update @grafana/scenes to canary with SetExactly support
- Add FacetedLabelsFilter component tests
- Add dev dashboard for faceted labels scenarios

Made-with: Cursor

* Add enableFacetedFilter as timeseries legend option

- Define TimeSeriesLegendOptions extending VizLegendOptions with
  enableFacetedFilter field (defaults to true)
- Add toggle in timeseries panel editor under Legend category
- Remove hardcoded enableFacetedFilter from TimeSeries component,
  let it flow via legend options spread
- Explicitly disable faceted filter in Explore graph
- Update dev dashboard with enableFacetedFilter in legend options
- Regenerate locale files

Made-with: Cursor

* Fix docked filter buttons hidden behind dimmed overlay

- Add zIndex to filterDockedActions so Clear all and Unpin
  buttons render above the dimmed FacetedLabelsFilter

Made-with: Cursor

* Guard faceted labels filter behind feature toggle

- Add vizLegendFacetedFilter experimental toggle in registry.go
- Gate panel editor option in module.tsx behind the toggle
- Gate rendering in TimeSeries.tsx behind the toggle
- Use TimeSeriesLegendOptions type for legend prop

Made-with: Cursor

* Consolidate FacetedLabelsFilter tests

Made-with: Cursor

* Restore limit support in bottom-placement legend

- Revert to InlineList for bottom placement to preserve
  the series limit feature (useLimit + "show all" button)
- filterAction is prepended before InlineList

Made-with: Cursor

* Add test for toggleAllForKey to fix coverage

- Cover Select all / Deselect all button in FacetedLabelsFilter
- Fixes Functions coverage regression for @grafana/dataviz-squad

Made-with: Cursor

* Update dev dashboard file count in search test

- Account for new timeseries-faceted-labels.json dashboard

Made-with: Cursor

* Update search test snapshot for new dev dashboard

- Add timeseries-faceted-labels to t00-all.json snapshot
- Update totalHits from 16 to 17

Made-with: Cursor

* Update search test snapshots for changed BM25 scores

- Adding a dashboard changes maxDocs which shifts IDF values
- Updated scores in all affected snapshot files

Made-with: Cursor

* Add E2E tests for faceted labels filter

- Test filter toggle, popover sections, name selection
- Test select all, clear all, pin to sidebar
- Test dimmed state when legend click conflicts with filter
- Add data-testid attributes to filter toggle and container

Made-with: Cursor

* Use gf-pin icon and move filter to left of name column

- Replace link icon with gf-pin for Pin to sidebar button
- Move filter toggle to left of name column header in table legend

Made-with: Cursor

* Bump @grafana/scenes to 7.1.5

- Replace canary version with stable 7.1.5 release

Made-with: Cursor

* Exclude node_modules from i18n extraction

- Nested node_modules under packages/ can contain .d.ts files
  that fail to parse, causing extraction to exit with error

Made-with: Cursor

* Add unit tests for PlotLegend faceted filter

- Test filter toggle visibility when enabled/disabled
- Test popover interaction and onToggleSeriesVisibility callback
- Test docked mode with clear all and unpin

Made-with: Cursor
2026-03-12 15:57:58 +01:00
2026-03-06 10:27:09 +01:00
2026-03-06 10:27:09 +01:00
2025-10-29 17:17:07 +01:00
2025-03-04 11:00:35 +00:00
2025-08-20 10:08:03 +00:00

Grafana Logo (Light) Grafana Logo (Dark)

The open-source platform for monitoring and observability

License Go Report Card

Grafana allows you to query, visualize, alert on and understand your metrics no matter where they are stored. Create, explore, and share dashboards with your team and foster a data-driven culture:

  • Visualizations: Fast and flexible client side graphs with a multitude of options. Panel plugins offer many different ways to visualize metrics and logs.
  • Dynamic Dashboards: Create dynamic & reusable dashboards with template variables that appear as dropdowns at the top of the dashboard.
  • Explore Metrics: Explore your data through ad-hoc queries and dynamic drilldown. Split view and compare different time ranges, queries and data sources side by side.
  • Explore Logs: Experience the magic of switching from metrics to logs with preserved label filters. Quickly search through all your logs or streaming them live.
  • Alerting: Visually define alert rules for your most important metrics. Grafana will continuously evaluate and send notifications to systems like Slack, PagerDuty, VictorOps, OpsGenie.
  • Mixed Data Sources: Mix different data sources in the same graph! You can specify a data source on a per-query basis. This works for even custom datasources.

Get started

Unsure if Grafana is for you? Watch Grafana in action on play.grafana.org!

Documentation

The Grafana documentation is available at grafana.com/docs.

Contributing

If you're interested in contributing to the Grafana project:

Share your contributor experience in our feedback survey to help us improve.

Get involved

This project is tested with BrowserStack.

License

Grafana is distributed under AGPL-3.0-only. For Apache-2.0 exceptions, see LICENSING.md.

Description
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Readme AGPL-3.0 2.8 GiB
Languages
TypeScript 52.5%
Go 44.9%
CUE 0.7%
Rich Text Format 0.4%
JavaScript 0.4%
Other 0.9%