21 Aug 2025 08:56 AM - edited 08 Jan 2026 04:40 PM
It's quite common to have dashboards display many tiles for individual components - for example multiple services. Luckily Monaco supports Go Templating.
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, 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 😎
I believe a sample is more than enough. I've put the examples in my GitHub repository of advanced configuration as code samples here:
https://github.com/juliusloman/dynatrace-configuration-as-code-advanced-samples
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:
22 Aug 2025 01:37 PM
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.
22 Aug 2025 02:21 PM
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 to another Monaco configuration in the list. @nico_riedmann any suggestions? 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.
22 Aug 2025 02:24 PM
This is really cool. I'd like to see something similar for modern dashboards too. 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.
22 Aug 2025 02:30 PM
@36Krazyfists certainly possible with Gen3 dashboards. I agree, the new dashboard JSONs are less friendly for editing 🙃
22 Aug 2025 08:46 PM
@36Krazyfists I updated this post with Gen3 dashboard example - same approach, just you have to loop twice through the list.
Featured Posts