Add "keys" or identifiers to dashboard panels for removal and sorting

Background

Both common_metrics.yml and custom dashboards do not provide a guid or other identifiable information to some of their data structures which should be identified in the frontend. The data is sent to the frontend in JSON format as metrics_dashboard.json.

Problem

Data cannot be identified to deletion or updates when required.

Proposal

Similar to the generated metric_id, the frontend could add some generated guid or key to the data for later use when manipulating the data. Example:

  • Add dashboard.panel_groups[0].key
  • Add dashboard.panel_groups[0].panels[0].key

The key can be generated from other fields, and most be unique to a given dashboard.

Original discussion

The following discussion from !21096 (merged) should be addressed:

  • @nkipling started a discussion: (+1 comment)

    @mrincon The changes here look okay to me. I'm not a fan of using the index to look up which panel to remove (especially in a context where it can change due to reordering), but it doesn't appear they have any other easily identifying properties. 🤔

Edited Dec 04, 2019 by Miguel Rincon
Assignee Loading
Time tracking Loading