# PRO TIP - Automatic grid layout on a dashboard with monaco

**URL:** <https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055>\
**Category:** Dynatrace Tips\
**Tags:** monaco, dashboards\
**Created:** [August 21, 2025, 7:56am UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055 "2025-08-21T07:56:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 21, 2025, 7:56am UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055/1 "2025-08-21T07:56:19Z")

</div>

It’s quite common to have dashboards display many tiles for individual components - for example multiple services. Luckily Monaco supports [Go Templating](https://docs.dynatrace.com/docs/shortlink/configuration-as-code-advanced-use-case).

Let’s consider a Gen2 and a Gen3 dashboard where we want to easily generate a grid of tiles and just specify a set of parameters for each tile. It’s just required to do some basic arithmetic to calculate the position of each tile and then wrap the tiles when we reach a defined width of the grid. Unfortunately,&nbsp;not even basic arithmetic is possible in the gotemplate engine used by monaco, so we need to do it creatively by using printf and len functions&nbsp;:smiling\_face\_with\_sunglasses:

I believe a sample is more than enough. I’ve put the examples in my GitHub repository of advanced configuration as code samples here:

> **[GitHub - juliusloman/dynatrace-configuration-as-code-advanced-samples: Advanced samples for configuration as code](https://github.com/juliusloman/dynatrace-configuration-as-code-advanced-samples)**
>
> Advanced samples for configuration as code

When deployed, we will get a nice grid of tiles on a dashboard, and we can add new services just in the YAML without touching the JSON:

 ![Julius_Loman_0-1755891747634.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/4/64a07a7dcd24f6bbc809c9054deba11ffc125669.png)

 ![Julius_Loman_0-1755762910717.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/5/35803936a71c0512024bc80c613f2d1f75fb650e.png)

---

<div class="post-metadata">

**Author:** ![lubrman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/lubrman/32/7353_2.png) [@lubrman](https://community.dynatrace.com/u/lubrman)\
**Post date:** [August 21, 2025, 8:16am UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055/2 "2025-08-21T08:16:18Z")

</div>

Elegant solution

---

<div class="post-metadata">

**Author:** ![lubrman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/lubrman/32/7353_2.png) [@lubrman](https://community.dynatrace.com/u/lubrman)\
**Post date:** [August 22, 2025, 12:37pm UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055/3 "2025-08-22T12:37:21Z")

</div>

For completeness, it’s even better to extract the metrics into YAML and then send them into JSON. This way, each tile can display different data. Such an approach would also allow using the tiles within a CI/CD pipeline, where, for example, during an application deployment a dashboard could be created based on the specific requirements of the application owner.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 22, 2025, 1:21pm UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055/4 "2025-08-22T13:21:05Z")

</div>

Sure, this example above is the bare minimum for showcasing the possibilities. It’s also possible to use different tile types of course, like service or host health.

What I was unable to do was provide a [reference](https://docs.dynatrace.com/docs/deliver/configuration-as-code/monaco/configuration/yaml-configuration#reference) to another Monaco configuration in the list. [@nico\_riedmann](https://community.dynatrace.com/user/30567)&nbsp; any suggestions?&nbsp; For example, to have the tag a reference to an auto-tag deployed by Monaco in the same project. Monaco does not seem to resolve dependencies in this parameter type.

---

<div class="post-metadata">

**Author:** ![36Krazyfists](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/36krazyfists/32/37434_2.png) [@36Krazyfists](https://community.dynatrace.com/u/36Krazyfists)\
**Post date:** [August 22, 2025, 1:24pm UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055/5 "2025-08-22T13:24:35Z")

</div>

This is really cool.&nbsp; I’d like to see something similar for modern dashboards too.&nbsp; Now that RUM on Grail is available, we’re starting to move more and more of our dashboards to the new framework, but I find the JSON not as friendly to read as gen 2 dashboards.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 22, 2025, 1:30pm UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055/6 "2025-08-22T13:30:36Z")

</div>

[@36Krazyfists](https://community.dynatrace.com/user/41155)&nbsp;certainly possible with Gen3 dashboards. I agree, the new dashboard JSONs are less friendly for editing&nbsp;:upside\_down\_face:

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 22, 2025, 7:46pm UTC](https://community.dynatrace.com/t/pro-tip-automatic-grid-layout-on-a-dashboard-with-monaco/53055/7 "2025-08-22T19:46:25Z")

</div>

[@36Krazyfists](https://community.dynatrace.com/user/41155)&nbsp;I updated this post with Gen3 dashboard example - same approach, just you have to loop twice through the list.
