<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic PRO TIP - Build dashboards with Dashboard snippets with Monaco Configuration as code in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Build-dashboards-with-Dashboard-snippets-with-Monaco/m-p/292700#M1866</link>
    <description>&lt;P&gt;Building reusable dashboards is not easy. Sometimes you need to include the same set of widgets across your dashboards and make changes in a single place in your config as code.&lt;/P&gt;&lt;P&gt;Dynatrace Monaco has supported the file parameters already for a while, which allows you to include data from a file as a parameter. So we want to define our snippets and use them in our dashboards.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In my example for Dashboards Classic, I have two snippets:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;JVM - tiles with JVM metrics&lt;/LI&gt;&lt;LI&gt;Service Metrics - tiles with service metrics&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We need to specify the boundaries (basically top left position of the snippet) and path to the include file. The escape: false parameters ensures the file won't be escaped and will be processed correctly. We also need to reference the parameters being used in the snippet.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Of course, both of the snippet references need to be included in the main dashboard.json.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;configs:
- id: dashboard-snippet1
  config:
    name: "Dashboard with Snippets1"
    parameters:
      # General parameters
      serviceTag: "service1"
      processTag: "process1"

      # Snippet for JVM Metrics
      snippet_JVM_left: 0  # left snippet boundary
      snippet_JVM_top: 0   # top snippet boundary
      snippet_JVM:
        type: file
        path: snippets/JVM.json
        escape: false
        references:
          - snippet_JVM_left
          - snippet_JVM_top
          - processTag

      # Snippet for Service Metrics
      snippet_ServiceMetrics_left: 0  # left snippet boundary
      snippet_ServiceMetrics_top: 304 # top snippet boundary - this has to be a constant we can't do relative calculation
      snippet_ServiceMetrics:
        type: file
        path: snippets/ServiceMetrics.json
        escape: false
        references:
          - snippet_ServiceMetrics_left
          - snippet_ServiceMetrics_top
          - serviceTag

    template: dashboard.json
    skip: false
  type:
    api: dashboard&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Snippets themselves have to lay out it's tiles based on parameters. This allows having relative positions of the tiles on a classic dashboard.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A complete sample is available in my GitHub repository&amp;nbsp;&lt;A href="https://github.com/juliusloman/dynatrace-configuration-as-code-advanced-samples" target="_blank"&gt;https://github.com/juliusloman/dynatrace-configuration-as-code-advanced-samples&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jan 2026 17:15:03 GMT</pubDate>
    <dc:creator>Julius_Loman</dc:creator>
    <dc:date>2026-01-08T17:15:03Z</dc:date>
    <item>
      <title>PRO TIP - Build dashboards with Dashboard snippets with Monaco Configuration as code</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Build-dashboards-with-Dashboard-snippets-with-Monaco/m-p/292700#M1866</link>
      <description>&lt;P&gt;Building reusable dashboards is not easy. Sometimes you need to include the same set of widgets across your dashboards and make changes in a single place in your config as code.&lt;/P&gt;&lt;P&gt;Dynatrace Monaco has supported the file parameters already for a while, which allows you to include data from a file as a parameter. So we want to define our snippets and use them in our dashboards.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In my example for Dashboards Classic, I have two snippets:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;JVM - tiles with JVM metrics&lt;/LI&gt;&lt;LI&gt;Service Metrics - tiles with service metrics&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We need to specify the boundaries (basically top left position of the snippet) and path to the include file. The escape: false parameters ensures the file won't be escaped and will be processed correctly. We also need to reference the parameters being used in the snippet.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Of course, both of the snippet references need to be included in the main dashboard.json.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;configs:
- id: dashboard-snippet1
  config:
    name: "Dashboard with Snippets1"
    parameters:
      # General parameters
      serviceTag: "service1"
      processTag: "process1"

      # Snippet for JVM Metrics
      snippet_JVM_left: 0  # left snippet boundary
      snippet_JVM_top: 0   # top snippet boundary
      snippet_JVM:
        type: file
        path: snippets/JVM.json
        escape: false
        references:
          - snippet_JVM_left
          - snippet_JVM_top
          - processTag

      # Snippet for Service Metrics
      snippet_ServiceMetrics_left: 0  # left snippet boundary
      snippet_ServiceMetrics_top: 304 # top snippet boundary - this has to be a constant we can't do relative calculation
      snippet_ServiceMetrics:
        type: file
        path: snippets/ServiceMetrics.json
        escape: false
        references:
          - snippet_ServiceMetrics_left
          - snippet_ServiceMetrics_top
          - serviceTag

    template: dashboard.json
    skip: false
  type:
    api: dashboard&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Snippets themselves have to lay out it's tiles based on parameters. This allows having relative positions of the tiles on a classic dashboard.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A complete sample is available in my GitHub repository&amp;nbsp;&lt;A href="https://github.com/juliusloman/dynatrace-configuration-as-code-advanced-samples" target="_blank"&gt;https://github.com/juliusloman/dynatrace-configuration-as-code-advanced-samples&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 17:15:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Build-dashboards-with-Dashboard-snippets-with-Monaco/m-p/292700#M1866</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2026-01-08T17:15:03Z</dc:date>
    </item>
  </channel>
</rss>

