Add filters option to dashboard yml config

What does this MR do and why?

Currently dashboard filters are enabled by default and disabled in code for certain dashboards. This has obvious limitations which we want to address.

This MR makes dashboard filters configurable through yaml config:

filters: 
  excludeAnonymousUsers
   enabled: true
  dateRange: 
    enabled: true
    # 'options' and 'default' can be added later

As discussed, filters will be disabled by default, in order not to break Optimise dashboards ( given PA is not live ). It should also be easier to opt-in filters that user might need instead of explicitly having to disable a bunch. See also Multiversion compatibility below.

Changes:

  • Support filters attribute in yaml config
  • Render dashboard filters based on config rather than being hardcoded. If not configured, filters are off by default.
  • Enable filters for builtin PA dashboards

Note on Multiversion compatibility:

Since Product Analytics is not a live feature, we don't need to guarantee multiversion compatibility:

  • Old frontend , new backend : Filters are hardcoded, so no change there
  • New frontend , old backend: Filters are disabled by default when filters config is not specified , so Value Stream (live feature) will work correctly. Product Analytics dashboard will break, but this feature is not live and under FF and we are ok with breaking it.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
  • Product Analytics builtin dashboards (filters ON):

image.png

image.png

  • Value Stream builtin dashboard (filters OFF):

image.png

  • Custom dashboard (filters ON by default)

image.png

  • Product Analytics builtin dashboards (filters ON):

image.png

image.png

  • Value Stream builtin dashboard (filters OFF):

image.png

  • Custom dashboard (filters OFF by default)
title: Test Dashboard
version: "2"
description: this is a test

image.png

  • Custom dashboard (with filters ON by config)
title: Test Dashboard
version: "2"
description: this is a test
filters: 
  dateRange: true

image.png

How to set up and validate locally

  1. You need a GitLab Ultimate license.
  2. Follow the guide to enable product analytics on your GDK.
  3. Navigate to Project > Analytics > Analytics dashboards.
  4. Confirm that Value Stream Dashboard has no filters enabled
  5. Config that Audience and Behaviour dashboard has filters enabled
  6. Clone one of the builtin dashboards, then edit the associated config file and play around with the filters. Confirm that the UI updates accordingly.
Edited by Daniele Rossetti

Merge request reports

Loading