Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Use maps internally for dashboard panels in jsonnet library #4

Open
malcolmholmes opened this issue Oct 15, 2020 · 0 comments
Open

Comments

@malcolmholmes
Copy link
Collaborator

When we render Jsonnet for adding panels to dashboards, we add a panel to a list. In Jsonnet, this makes it difficult to later interact with those dashboards.

There's a simple trick that can solve this: have the addPanel method add the panel to a hidden map, and add its name to a hidden field order list. Then, render the actual panel list from these with a simple for loop.

This way, the dashboard can later be amended by patching the panel map without the need for iteration as would be needed if it were a list.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant