<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Observability as code on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/</link><description>Recent content in Observability as code on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/as-code/observability-as-code/index.xml" rel="self" type="application/rss+xml"/><item><title>Introduction to Grafana CLI</title><link>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/grafana-cli/</link><pubDate>Fri, 03 Apr 2026 12:35:46 -0500</pubDate><guid>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/grafana-cli/</guid><content><![CDATA[

  
    
      
    
  
&lt;div class=&#34;docs-hero my-2 &#34;&gt;
  &lt;div class=&#34;d-flex flex-direction-row flex-direction-column-small column-gap-20 row-gap-10 justify-content-start align-items-center align-items-start-small flex-wrap &#34;&gt;&lt;div class=&#34;d-flex flex-direction-column flex-1-1 minw-400 minw-xs-unset&#34;&gt;
      &lt;div&gt;&lt;h1
  
  id=&#34;observability-as-code&#34;
  &gt;Observability as Code&lt;/h1&gt;&lt;/div&gt;
      
        &lt;div class=&#34;&#34;&gt;Using Observability as Code, you can version, automate, and scale Grafana configurations, including dashboards and observability workflows.&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;explore&#34;&gt;Explore&lt;/h2&gt;

&lt;div class=&#34;w-100p&#34;&gt;
  &lt;div class=&#34;card-content-grid mt-1&#34;&gt;&lt;a class=&#34;card sm&#34; href=&#34;./grafana-cli/&#34;&gt;
  &lt;div class=&#34;card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start &#34;&gt;&lt;div class=&#34;card-title body-default fw-500 lh-2 text-gray-16&#34;&gt;Grafana CLI&lt;/div&gt;&lt;div class=&#34;card-description body-small text-gray-12 fw-400&#34;&gt;Grafana CLI (&lt;code&gt;grafanactl&lt;/code&gt;) is a command-line tool designed to simplify interaction with Grafana instances using the new REST APIs. You can authenticate, manage multiple environments, and perform administrative tasks from the terminal. It&amp;rsquo;s suitable for CI/CD pipelines, local development, or free-form tasks.&lt;/div&gt;&lt;/div&gt;
&lt;/a&gt;&lt;a class=&#34;card sm&#34; href=&#34;./foundation-sdk/&#34;&gt;
  &lt;div class=&#34;card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start &#34;&gt;&lt;div class=&#34;card-title body-default fw-500 lh-2 text-gray-16&#34;&gt;Foundation SDK&lt;/div&gt;&lt;div class=&#34;card-description body-small text-gray-12 fw-400&#34;&gt;The Grafana Foundation SDK is a set of tools, types, and libraries that let you define Grafana dashboards and resources using familiar programming languages like Go, TypeScript, Python, Java, and PHP. Use it in conjunction with &lt;code&gt;grafanactl&lt;/code&gt; to push your programmatically generated resources.&lt;/div&gt;&lt;/div&gt;
&lt;/a&gt;&lt;a class=&#34;card sm&#34; href=&#34;./schema-v2/&#34;&gt;
  &lt;div class=&#34;card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start &#34;&gt;&lt;div class=&#34;card-title body-default fw-500 lh-2 text-gray-16&#34;&gt;JSON schema v2&lt;/div&gt;&lt;div class=&#34;card-description body-small text-gray-12 fw-400&#34;&gt;Grafana dashboards are represented as JSON objects that store metadata, panels, variables, and settings. Observability as Code works with all versions of the JSON model, and it&amp;rsquo;s fully compatible with version 2.&lt;/div&gt;&lt;/div&gt;
&lt;/a&gt;&lt;a class=&#34;card sm&#34; href=&#34;./provision-resources/intro-git-sync/&#34;&gt;
  &lt;div class=&#34;card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start &#34;&gt;&lt;div class=&#34;card-title body-default fw-500 lh-2 text-gray-16&#34;&gt;Git Sync (private preview)&lt;/div&gt;&lt;div class=&#34;card-description body-small text-gray-12 fw-400&#34;&gt;Git Sync lets you store your dashboard files in a GitHub repository and synchronize those changes with your Grafana instance, enabling version control, branching, and pull requests directly from Grafana.&lt;/div&gt;&lt;/div&gt;
&lt;/a&gt;&lt;a class=&#34;card sm&#34; href=&#34;./provision-resources/&#34;&gt;
  &lt;div class=&#34;card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start &#34;&gt;&lt;div class=&#34;card-title body-default fw-500 lh-2 text-gray-16&#34;&gt;File provisioning (private preview)&lt;/div&gt;&lt;div class=&#34;card-description body-small text-gray-12 fw-400&#34;&gt;File provisioning in Grafana lets you include resources, including folders and dashboard JSON files, that are stored in a local file system.&lt;/div&gt;&lt;/div&gt;
&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;div class="docs-hero my-2 ">
&lt;div class="d-flex flex-direction-row flex-direction-column-small column-gap-20 row-gap-10 justify-content-start align-items-center align-items-start-small flex-wrap ">&lt;div class="d-flex flex-direction-column flex-1-1 minw-400 minw-xs-unset">
&lt;div>&lt;h1
id="observability-as-code"
>Observability as Code&lt;/h1>&lt;/div>
&lt;div class="">Using Observability as Code, you can version, automate, and scale Grafana configurations, including dashboards and observability workflows.&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;h2 id="explore">Explore&lt;/h2>
&lt;div class="w-100p">
&lt;div class="card-content-grid mt-1">&lt;a class="card sm" href="./grafana-cli/">
&lt;div class="card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start ">&lt;div class="card-title body-default fw-500 lh-2 text-gray-16">Grafana CLI&lt;/div>&lt;div class="card-description body-small text-gray-12 fw-400">Grafana CLI (&lt;code>grafanactl&lt;/code>) is a command-line tool designed to simplify interaction with Grafana instances using the new REST APIs. You can authenticate, manage multiple environments, and perform administrative tasks from the terminal. It&amp;rsquo;s suitable for CI/CD pipelines, local development, or free-form tasks.&lt;/div>&lt;/div>
&lt;/a>&lt;a class="card sm" href="./foundation-sdk/">
&lt;div class="card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start ">&lt;div class="card-title body-default fw-500 lh-2 text-gray-16">Foundation SDK&lt;/div>&lt;div class="card-description body-small text-gray-12 fw-400">The Grafana Foundation SDK is a set of tools, types, and libraries that let you define Grafana dashboards and resources using familiar programming languages like Go, TypeScript, Python, Java, and PHP. Use it in conjunction with &lt;code>grafanactl&lt;/code> to push your programmatically generated resources.&lt;/div>&lt;/div>
&lt;/a>&lt;a class="card sm" href="./schema-v2/">
&lt;div class="card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start ">&lt;div class="card-title body-default fw-500 lh-2 text-gray-16">JSON schema v2&lt;/div>&lt;div class="card-description body-small text-gray-12 fw-400">Grafana dashboards are represented as JSON objects that store metadata, panels, variables, and settings. Observability as Code works with all versions of the JSON model, and it&amp;rsquo;s fully compatible with version 2.&lt;/div>&lt;/div>
&lt;/a>&lt;a class="card sm" href="./provision-resources/intro-git-sync/">
&lt;div class="card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start ">&lt;div class="card-title body-default fw-500 lh-2 text-gray-16">Git Sync (private preview)&lt;/div>&lt;div class="card-description body-small text-gray-12 fw-400">Git Sync lets you store your dashboard files in a GitHub repository and synchronize those changes with your Grafana instance, enabling version control, branching, and pull requests directly from Grafana.&lt;/div>&lt;/div>
&lt;/a>&lt;a class="card sm" href="./provision-resources/">
&lt;div class="card-content-container p-1 d-flex flex-direction-column align-items-start justify-content-start ">&lt;div class="card-title body-default fw-500 lh-2 text-gray-16">File provisioning (private preview)&lt;/div>&lt;div class="card-description body-small text-gray-12 fw-400">File provisioning in Grafana lets you include resources, including folders and dashboard JSON files, that are stored in a local file system.&lt;/div>&lt;/div>
&lt;/a>&lt;/div>
&lt;/div></description></item><item><title>Foundation SDK</title><link>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/foundation-sdk/</link><pubDate>Fri, 03 Apr 2026 12:35:46 -0500</pubDate><guid>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/foundation-sdk/</guid><content><![CDATA[&lt;h1 id=&#34;get-started-with-the-grafana-foundation-sdk&#34;&gt;Get started with the Grafana Foundation SDK&lt;/h1&gt;
&lt;p&gt;The &lt;a href=&#34;https://github.com/grafana/grafana-foundation-sdk&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Foundation SDK&lt;/a&gt; is a set of tools, types, and libraries that let you define Grafana dashboards and resources using strongly typed code. By writing your dashboards as code, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Leverage strong typing:&lt;/strong&gt; Catch errors at compile time, ensuring more reliable configurations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enhance version control:&lt;/strong&gt; Track changes seamlessly using standard version control systems like Git.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automate deployments:&lt;/strong&gt; Integrate dashboard provisioning into your CI/CD pipelines for consistent and repeatable setups.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The SDK supports multiple programming languages, including Go, TypeScript, Python, PHP, and Java, so you can choose the one that best fits your development environment.&lt;/p&gt;


  &lt;div
    class=&#34;youtube-lazyload responsive-video&#34;
    data-embed=&#34;_OKQoABmg0Q&#34;
    data-url=&#34;https://www.youtube.com/embed/_OKQoABmg0Q?autoplay=1&#34;
    data-title=&#34;YouTube Video&#34;
  &gt;
    &lt;div class=&#34;play-button&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Ensure you have the following prerequisites:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Programming environment:&lt;/strong&gt; Set up for your chosen language. For example: Go, Node.js for TypeScript, or Python 3.x for Python.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grafana instance:&lt;/strong&gt; A running Grafana instance compatible with the SDK version you’re using (refer to the &lt;a href=&#34;https://github.com/grafana/grafana-foundation-sdk#navigating-the-sdk&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;compatibility matrix&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Package manager:&lt;/strong&gt; Appropriate for your language, for example, &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&lt;/code&gt; for TypeScript or &lt;code&gt;pip&lt;/code&gt; for Python.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get started, clone the &lt;a href=&#34;https://github.com/grafana/intro-to-foundation-sdk&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;intro-to-foundation-sdk repository&lt;/a&gt; to access examples and a &lt;code&gt;docker-compose&lt;/code&gt; stack.&lt;/p&gt;
&lt;h2 id=&#34;install-the-grafana-foundation-sdk&#34;&gt;Install the Grafana Foundation SDK&lt;/h2&gt;
&lt;p&gt;Select the &lt;code&gt;go&lt;/code&gt; or &lt;code&gt;typescript&lt;/code&gt; tab to view instructions to install the SDK.
For other languages, refer to the Grafana Foundation SDK documentation for installation instructions.



  

  






  

  



  &lt;div class=&#34;code&#34; x-data=&#34;app_code([&amp;#34;go&amp;#34;,&amp;#34;typescript&amp;#34;], false)&#34; x-init=&#34;init()&#34; data-codetoggle=&#34;true&#34;&gt;
    &lt;div class=&#34;toggle-toolbar &#34;&gt;
      &lt;div&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;go&#39; }&#34; @click=&#34;$store.code.language = &#39;go&#39;&#34;&gt;
              &lt;span&gt;Go&lt;/span&gt;
            &lt;/button&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;typescript&#39; }&#34; @click=&#34;$store.code.language = &#39;typescript&#39;&#34;&gt;
              &lt;span&gt;typescript&lt;/span&gt;
            &lt;/button&gt;&lt;/div&gt;
      &lt;div class=&#34;d-flex&#34;&gt;&lt;span class=&#34;code-clipboard&#34; x-ref=&#34;tooltip&#34;&gt;
          &lt;button @click=&#34;copy()&#34;&gt;
            &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
            &lt;span&gt;Copy&lt;/span&gt;
          &lt;/button&gt;
        &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class=&#34;toggle-toolbar__border&#34;&gt;&lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div class=&#34;code-rendered&#34; &gt;
      
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Go&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-go&#34;&gt;go get github.com/grafana/grafana-foundation-sdk/go@next&amp;#43;cog-v0.0.x&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;typescript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-typescript&#34;&gt;npm install @grafana/grafana-foundation-sdk&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

    &lt;/div&gt;
  &lt;/div&gt;

&lt;/p&gt;
&lt;h2 id=&#34;grafana-foundation-sdk-overview&#34;&gt;Grafana Foundation SDK Overview&lt;/h2&gt;
&lt;p&gt;Here&amp;rsquo;s a quick overview of how the Grafana Foundation SDK works:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Builder pattern:&lt;/strong&gt; The SDK uses a chainable builder pattern to let you define dashboards fluently. You start with a &lt;code&gt;DashboardBuilder&lt;/code&gt;, then add panels, queries, and other components step by step.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strong typing:&lt;/strong&gt; Everything in the SDK is strongly typed. This gives you autocompletion in your IDE, catches mistakes early, and helps ensure you&amp;rsquo;re always using valid configuration values.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Structured options:&lt;/strong&gt; When a configuration get complex (like data reduction or display settings), the SDK uses typed option builders to keep things readable and predictable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;rsquo;ll see these concepts in action in the next example. These concepts are explained in more detail afterwards.&lt;/p&gt;
&lt;h2 id=&#34;create-a-dashboard&#34;&gt;Create a dashboard&lt;/h2&gt;
&lt;p&gt;The following example demonstrates how you can create a simple dashboard:&lt;/p&gt;



  

  






  

  



  &lt;div class=&#34;code&#34; x-data=&#34;app_code([&amp;#34;go&amp;#34;,&amp;#34;typescript&amp;#34;], false)&#34; x-init=&#34;init()&#34; data-codetoggle=&#34;true&#34;&gt;
    &lt;div class=&#34;toggle-toolbar &#34;&gt;
      &lt;div&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;go&#39; }&#34; @click=&#34;$store.code.language = &#39;go&#39;&#34;&gt;
              &lt;span&gt;Go&lt;/span&gt;
            &lt;/button&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;typescript&#39; }&#34; @click=&#34;$store.code.language = &#39;typescript&#39;&#34;&gt;
              &lt;span&gt;typescript&lt;/span&gt;
            &lt;/button&gt;&lt;/div&gt;
      &lt;div class=&#34;d-flex&#34;&gt;&lt;span class=&#34;code-clipboard&#34; x-ref=&#34;tooltip&#34;&gt;
          &lt;button @click=&#34;copy()&#34;&gt;
            &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
            &lt;span&gt;Copy&lt;/span&gt;
          &lt;/button&gt;
        &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class=&#34;toggle-toolbar__border&#34;&gt;&lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div class=&#34;code-rendered&#34; &gt;
      
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Go&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-go&#34;&gt;package main

// Import the appropriate Grafana Foundation SDK packages
import (
  &amp;#34;encoding/json&amp;#34;
  &amp;#34;log&amp;#34;

  &amp;#34;github.com/grafana/grafana-foundation-sdk/go/cog&amp;#34;
  &amp;#34;github.com/grafana/grafana-foundation-sdk/go/common&amp;#34;
  &amp;#34;github.com/grafana/grafana-foundation-sdk/go/dashboard&amp;#34;
  &amp;#34;github.com/grafana/grafana-foundation-sdk/go/stat&amp;#34;
  &amp;#34;github.com/grafana/grafana-foundation-sdk/go/testdata&amp;#34;
  &amp;#34;github.com/grafana/grafana-foundation-sdk/go/timeseries&amp;#34;
)

func main() {
  // Define a data source reference for our testdata data source
  testdataRef := dashboard.DataSourceRef{
    Type: cog.ToPtr(&amp;#34;grafana-testdata-datasource&amp;#34;),
    Uid:  cog.ToPtr(&amp;#34;testdata&amp;#34;),
  }

  // Define our dashboard as strongly typed code
  builder := dashboard.NewDashboardBuilder(&amp;#34;My Dashboard&amp;#34;).
    WithPanel(
      stat.NewPanelBuilder().
        Title(&amp;#34;Version&amp;#34;).
        Datasource(testdataRef).
        ReduceOptions(common.NewReduceDataOptionsBuilder().
          Calcs([]string{&amp;#34;lastNotNull&amp;#34;}).
          Fields(&amp;#34;/.*/&amp;#34;)).
        WithTarget(
          testdata.NewDataqueryBuilder().
            ScenarioId(&amp;#34;csv_content&amp;#34;).
            CsvContent(&amp;#34;version\nv1.2.3&amp;#34;),
        ),
    ).
    WithPanel(
      timeseries.NewPanelBuilder().
        Title(&amp;#34;Random Time Series&amp;#34;).
        Datasource(testdataRef).
        WithTarget(
          testdata.NewDataqueryBuilder().
            ScenarioId(&amp;#34;random_walk&amp;#34;),
        ),
    )

  // Build the dashboard - errors in configuration will be thrown here
  dashboard, err := builder.Build()
  if err != nil {
    log.Fatalf(&amp;#34;failed to build dashboard: %v&amp;#34;, err)
  }

  // Output the generated dashboard as JSON
  dashboardJson, err := json.MarshalIndent(dashboard, &amp;#34;&amp;#34;, &amp;#34;  &amp;#34;)
  if err != nil {
    log.Fatalf(&amp;#34;failed to marshal dashboard: %v&amp;#34;, err)
  }

  log.Printf(&amp;#34;Dashboard JSON:\n%s&amp;#34;, dashboardJson)
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;typescript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-typescript&#34;&gt;// Import the appropriate Grafana Foundation SDK packages
import * as common from &amp;#39;@grafana/grafana-foundation-sdk/common&amp;#39;;
import * as dashboard from &amp;#39;@grafana/grafana-foundation-sdk/dashboard&amp;#39;;
import * as stat from &amp;#39;@grafana/grafana-foundation-sdk/stat&amp;#39;;
import * as testdata from &amp;#39;@grafana/grafana-foundation-sdk/testdata&amp;#39;;
import * as timeseries from &amp;#39;@grafana/grafana-foundation-sdk/timeseries&amp;#39;;

// Define a data source reference for our testdata data source
const testDataRef: dashboard.DataSourceRef = {
  type: &amp;#39;grafana-testdata-datasource&amp;#39;,
  uid: &amp;#39;testdata&amp;#39;,
};

// Define our dashboard as strongly typed code
const builder = new dashboard.DashboardBuilder(&amp;#39;My Dashboard&amp;#39;)
  .withPanel(
    new stat.PanelBuilder()
      .title(&amp;#39;Version&amp;#39;)
      .reduceOptions(new common.ReduceDataOptionsBuilder().calcs([&amp;#39;lastNotNull&amp;#39;]).fields(&amp;#39;/.*/&amp;#39;))
      .datasource(testdataRef)
      .withTarget(new testdata.DataqueryBuilder().scenarioId(&amp;#39;csv_content&amp;#39;).csvContent(&amp;#39;version\nv1.2.3&amp;#39;))
  )
  .withPanel(
    new timeseries.PanelBuilder()
      .title(&amp;#39;Random Time Series&amp;#39;)
      .datasource(testdataRef)
      .withTarget(new testdata.DataqueryBuilder().scenarioId(&amp;#39;random_walk&amp;#39;))
  );

// Build the dashboard - errors in configuration will be thrown here
const dashboard = builder.build();

// Output the generated dashboard as JSON
console.log(JSON.stringify(dashboard, null, 2));&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

    &lt;/div&gt;
  &lt;/div&gt;


&lt;p&gt;This code defines a dashboard titled “My Dashboard” with a two panels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a simple stat panel displaying a version number, and&lt;/li&gt;
&lt;li&gt;a time series panel displaying randomized data from the &lt;code&gt;testdata&lt;/code&gt; data source &lt;code&gt;random_walk&lt;/code&gt; scenario.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;export-and-use-the-json&#34;&gt;Export and use the JSON&lt;/h2&gt;
&lt;p&gt;After you&amp;rsquo;ve defined your dashboard as code, build the final dashboard representation using the dashboard builder (typically using the &lt;code&gt;build()&lt;/code&gt; function depending on language choice) and output the result as a JSON.&lt;/p&gt;
&lt;p&gt;With the JSON payload, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Manually import:&lt;/strong&gt; Paste into Grafana’s dashboard import feature.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automate:&lt;/strong&gt; Use 
    &lt;a href=&#34;/docs/grafana/v12.4/developer-resources/api-reference/http-api/&#34;&gt;Grafana&amp;rsquo;s API&lt;/a&gt; or the &lt;a href=&#34;../grafana-cli/&#34;&gt;Grafana CLI&lt;/a&gt; to programmatically upload the dashboard JSON.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;concepts&#34;&gt;Concepts&lt;/h2&gt;
&lt;p&gt;Now that you&amp;rsquo;ve seen how to define a basic dashboard using code, let&amp;rsquo;s take a moment to explain how it all works behind the scenes. The Grafana Foundation SDK is built around a few core concepts that make your dashboards structured, reusable, and strongly typed.&lt;/p&gt;
&lt;h3 id=&#34;builders&#34;&gt;Builders&lt;/h3&gt;
&lt;p&gt;The SDK follows a builder pattern, which lets you compose dashboards step-by-step using chained method calls.
Almost every piece of the dashboard, including dashboards, panels, rows, queries, and variables, has its own &lt;code&gt;Builder&lt;/code&gt; class.&lt;/p&gt;
&lt;p&gt;Here are a few you&amp;rsquo;ve already seen:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DashboardBuilder&lt;/code&gt; - Starts the dashboard definition and sets global configuration settings like title, UID, refresh interval, time range, etc.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PanelBuilder&lt;/code&gt; - Creates individual visualizations like time series panels, stat panels, or log panels.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DataqueryBuilder&lt;/code&gt; - Defines how a panel fetches data, for example, from Prometheus or the &lt;code&gt;testdata&lt;/code&gt; plugin.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Builders are chainable, so you can fluently compose dashboards in a readable, structured way:&lt;/p&gt;



  

  






  

  



  &lt;div class=&#34;code&#34; x-data=&#34;app_code([&amp;#34;go&amp;#34;,&amp;#34;typescript&amp;#34;], false)&#34; x-init=&#34;init()&#34; data-codetoggle=&#34;true&#34;&gt;
    &lt;div class=&#34;toggle-toolbar &#34;&gt;
      &lt;div&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;go&#39; }&#34; @click=&#34;$store.code.language = &#39;go&#39;&#34;&gt;
              &lt;span&gt;Go&lt;/span&gt;
            &lt;/button&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;typescript&#39; }&#34; @click=&#34;$store.code.language = &#39;typescript&#39;&#34;&gt;
              &lt;span&gt;typescript&lt;/span&gt;
            &lt;/button&gt;&lt;/div&gt;
      &lt;div class=&#34;d-flex&#34;&gt;&lt;span class=&#34;code-clipboard&#34; x-ref=&#34;tooltip&#34;&gt;
          &lt;button @click=&#34;copy()&#34;&gt;
            &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
            &lt;span&gt;Copy&lt;/span&gt;
          &lt;/button&gt;
        &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class=&#34;toggle-toolbar__border&#34;&gt;&lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div class=&#34;code-rendered&#34; &gt;
      
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Go&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-go&#34;&gt;stat.NewPanelBuilder().
  Title(&amp;#34;Version&amp;#34;).
  Datasource(testdataRef).
  ReduceOptions(common.NewReduceDataOptionsBuilder().
    Calcs([]string{&amp;#34;lastNotNull&amp;#34;}).
    Fields(&amp;#34;/.*/&amp;#34;)).
  WithTarget(
    testdata.NewDataqueryBuilder().
      ScenarioId(&amp;#34;csv_content&amp;#34;).
      CsvContent(&amp;#34;version\nv1.2.3&amp;#34;),
  )&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;typescript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-typescript&#34;&gt;new stat.PanelBuilder()
  .title(&amp;#39;Version&amp;#39;)
  .reduceOptions(new common.ReduceDataOptionsBuilder().calcs([&amp;#39;lastNotNull&amp;#39;]).fields(&amp;#39;/.*/&amp;#39;))
  .datasource(testdataRef)
  .withTarget(new testdata.DataqueryBuilder().scenarioId(&amp;#39;csv_content&amp;#39;).csvContent(&amp;#39;version\nv1.2.3&amp;#39;));&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

    &lt;/div&gt;
  &lt;/div&gt;


&lt;h3 id=&#34;types&#34;&gt;Types&lt;/h3&gt;
&lt;p&gt;The Grafana Foundation SDK uses strong types under the hood to help catch mistakes before you deploy a broken dashboard.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When setting a unit, you&amp;rsquo;ll get autocomplete suggestions for valid Grafana units like &lt;code&gt;&amp;quot;percent&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;bps&amp;quot;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When defining a time range, you&amp;rsquo;ll be guided to provide the correct structure, like &lt;code&gt;from&lt;/code&gt; and &lt;code&gt;to&lt;/code&gt; values.&lt;/li&gt;
&lt;li&gt;When referencing data sources, you&amp;rsquo;ll use a structured &lt;code&gt;DataSourceRef&lt;/code&gt; object with defined &lt;code&gt;type&lt;/code&gt; and &lt;code&gt;uid&lt;/code&gt; fields.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This helps you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Avoid typos or unsupported configuration values&lt;/li&gt;
&lt;li&gt;Get full autocomplete and inline documentation in your IDE&lt;/li&gt;
&lt;li&gt;Write dashboards that are less error-prone and easier to maintain&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Strong typing also makes it easier to build reusable patterns and components with confidence, especially in large codebases or teams.&lt;/p&gt;
&lt;h3 id=&#34;options&#34;&gt;Options&lt;/h3&gt;
&lt;p&gt;Most builder methods accept simple values like strings or numbers, but others expect more structured option objects. These are used for things like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ReduceDataOptions&lt;/code&gt; - How to reduce time series data into single values (e.g. last, avg).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;VizLegendOptions&lt;/code&gt; - Configure how the legend of a panel is displayed.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CanvasElementOptions&lt;/code&gt; - Define how the the various components of a Canvas panel should be displayed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example using options:&lt;/p&gt;



  

  






  

  



  &lt;div class=&#34;code&#34; x-data=&#34;app_code([&amp;#34;go&amp;#34;,&amp;#34;typescript&amp;#34;], false)&#34; x-init=&#34;init()&#34; data-codetoggle=&#34;true&#34;&gt;
    &lt;div class=&#34;toggle-toolbar &#34;&gt;
      &lt;div&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;go&#39; }&#34; @click=&#34;$store.code.language = &#39;go&#39;&#34;&gt;
              &lt;span&gt;Go&lt;/span&gt;
            &lt;/button&gt;&lt;button class=&#34;toggle-toolbar__item&#34; :class=&#34;{ &#39;toggle-toolbar__item-active&#39;: active === &#39;typescript&#39; }&#34; @click=&#34;$store.code.language = &#39;typescript&#39;&#34;&gt;
              &lt;span&gt;typescript&lt;/span&gt;
            &lt;/button&gt;&lt;/div&gt;
      &lt;div class=&#34;d-flex&#34;&gt;&lt;span class=&#34;code-clipboard&#34; x-ref=&#34;tooltip&#34;&gt;
          &lt;button @click=&#34;copy()&#34;&gt;
            &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
            &lt;span&gt;Copy&lt;/span&gt;
          &lt;/button&gt;
        &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class=&#34;toggle-toolbar__border&#34;&gt;&lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div class=&#34;code-rendered&#34; &gt;
      
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Go&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-go&#34;&gt;stat.NewPanelBuilder().
  ReduceOptions(common.NewReduceDataOptionsBuilder().
    Calcs([]string{&amp;#34;lastNotNull&amp;#34;}).
    Fields(&amp;#34;/.*/&amp;#34;))
  )&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;typescript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-typescript&#34;&gt;new stat.PanelBuilder().reduceOptions(new common.ReduceDataOptionsBuilder().calcs([&amp;#39;lastNotNull&amp;#39;]).fields(&amp;#39;/.*/&amp;#39;));&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

    &lt;/div&gt;
  &lt;/div&gt;


&lt;p&gt;By using option builders, you don&amp;rsquo;t need to manually construct deeply nested configuration objects. Instead, the SDK gives you a typed and guided API that mirrors a dashboards internal structure, making it easier to configure complex options without guesswork or referring back to the JSON schema.&lt;/p&gt;
&lt;h2 id=&#34;explore-a-real-world-example&#34;&gt;Explore a real-world example&lt;/h2&gt;
&lt;p&gt;If you want to explore further and see a more real-world example of using the Grafana Foundation SDK, watch the following walkthrough:&lt;/p&gt;


  &lt;div
    class=&#34;youtube-lazyload responsive-video&#34;
    data-embed=&#34;ZjWdGVsrCiQ&#34;
    data-url=&#34;https://www.youtube.com/embed/ZjWdGVsrCiQ?autoplay=1&#34;
    data-title=&#34;YouTube Video&#34;
  &gt;
    &lt;div class=&#34;play-button&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;p&gt;In this video, we generate a dashboard from code and deploy it using the Grafana API, covering patterns and practices you&amp;rsquo;d use in production environments. It also includes a working example of a web service that emits metrics and logs, and shows how to deploy a dashboard alongside it using Docker Compose.&lt;/p&gt;
&lt;p&gt;You can find the full source code for this example in the &lt;a href=&#34;https://github.com/grafana/intro-to-foundation-sdk/tree/main/generate-and-deploy-example&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;intro-to-foundation-sdk repository&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;/h2&gt;
&lt;p&gt;The Grafana Foundation SDK is designed to make dashboard creation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Composable&lt;/strong&gt; through the use of chainable builders&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Safe&lt;/strong&gt; with strong typing and clear APIs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configurable&lt;/strong&gt; using structured options for fine control&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you build more advanced dashboards, you’ll work with additional builders and types to support richer functionality.
The SDK supports not just panels and queries, but also variables, thresholds, field overrides, transformations, and more.
Refer to &lt;a href=&#34;https://grafana.github.io/grafana-foundation-sdk/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;the full API reference&lt;/a&gt; to explore what&amp;rsquo;s possible.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you understand the basics of using the Grafana Foundation SDK, here are some next steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Explore more features:&lt;/strong&gt; Check out the &lt;a href=&#34;https://grafana.github.io/grafana-foundation-sdk/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;full API reference&lt;/a&gt; to learn about advanced dashboard configurations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version control your dashboards:&lt;/strong&gt; Store your dashboard code in a Git repository to track changes over time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automate dashboard provisioning with CI/CD:&lt;/strong&gt; &lt;a href=&#34;./dashboard-automation&#34;&gt;Integrate the SDK into your CI/CD pipeline&lt;/a&gt; to deploy dashboards automatically.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="get-started-with-the-grafana-foundation-sdk">Get started with the Grafana Foundation SDK&lt;/h1>
&lt;p>The &lt;a href="https://github.com/grafana/grafana-foundation-sdk" target="_blank" rel="noopener noreferrer">Grafana Foundation SDK&lt;/a> is a set of tools, types, and libraries that let you define Grafana dashboards and resources using strongly typed code. By writing your dashboards as code, you can:&lt;/p></description></item><item><title>Introduction to Git Sync</title><link>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/git-sync/</link><pubDate>Fri, 03 Apr 2026 12:35:46 -0500</pubDate><guid>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/git-sync/</guid><content><![CDATA[&lt;h1 id=&#34;introduction-to-git-sync&#34;&gt;Introduction to Git Sync&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Git Sync is available in &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;public preview&lt;/a&gt; for Grafana Cloud, and is an &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;experimental feature&lt;/a&gt; in Grafana v12 for open source and Enterprise editions. Documentation and support is available based on the different tiers but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Git Sync is under development.&lt;/strong&gt; Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/usage-limits/&#34;&gt;Usage and performance limitations&lt;/a&gt; for more information. &lt;a href=&#34;/help/&#34;&gt;Contact Grafana&lt;/a&gt; for support or to report any issues you encounter and help us improve this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Git Sync in Grafana lets you synchronize your resources so you can store your dashboards as JSON files in any Git provider and manage them as code. You and your team can version control, collaborate, and automate deployments efficiently.&lt;/p&gt;
&lt;h2 id=&#34;how-it-works&#34;&gt;How it works&lt;/h2&gt;
&lt;p&gt;Git Sync allows you to connect external resources with your Grafana instance. After setup, all synchronized resources live in Git under the provisioned folder, and you can continue to have non-provisioned resources outside that folder.&lt;/p&gt;
&lt;p&gt;Git Sync is bidirectional. You can modify provisioned resources both from the Grafana UI or from the synced repository, and changes will be reflected in both places.&lt;/p&gt;
&lt;p&gt;Git Sync is available for any Git provider through a Pure Git repository type, and has specific enhanced integrations for GitHub, GitLab and Bitbucket. Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/usage-limits/&#34;&gt;Usage and performance limitations&lt;/a&gt; for further details, including usage tiers.&lt;/p&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/key-concepts/&#34;&gt;key concepts&lt;/a&gt; for more information on how Git Sync works.&lt;/p&gt;
&lt;h3 id=&#34;make-changes-in-the-grafana-ui&#34;&gt;Make changes in the Grafana UI&lt;/h3&gt;
&lt;p&gt;Whenever you modify a dashboard directly from the UI, you can also commit those changes to your synchronized Git repositories upon saving. You can configure settings to either enforce PR approvals before merging in your repository, or allow direct commits.&lt;/p&gt;
&lt;h3 id=&#34;make-changes-in-your-git-repositories&#34;&gt;Make changes in your Git repositories&lt;/h3&gt;
&lt;p&gt;Your Grafana instance polls the provisioned Git resources to synchronize. If you made any changes in your synchronized Git repositories, they will be updated in the Grafana database as well. The Grafana UI reads from the database and updates the UI to reflect these changes.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Without webhooks, Grafana polls for changes at the specified interval. The default polling interval is 60 seconds, and you can change this setting in the Grafana UI.&lt;/li&gt;
&lt;li&gt;If you enable the 
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/git-sync-setup/#configure-webhooks-and-image-rendering&#34;&gt;webhooks feature&lt;/a&gt;, repository notifications appear almost immediately.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;common-use-cases&#34;&gt;Common use cases&lt;/h2&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/provision-resources/git-sync-deployment-scenarios/&#34;&gt;Git Sync deployment scenarios&lt;/a&gt; for sample scenarios, including architecture and configuration details.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;You can use Git Sync for the following use cases:&lt;/p&gt;
&lt;h3 id=&#34;version-control-and-auditing&#34;&gt;Version control and auditing&lt;/h3&gt;
&lt;p&gt;Organizations can maintain a structured, version-controlled history of Grafana dashboards. The version control lets you revert to previous versions when necessary, compare modifications across commits, and ensure transparency in dashboard management.&lt;/p&gt;
&lt;p&gt;Additionally, having a detailed history of changes enhances compliance efforts, as teams can generate audit logs that document who made changes, when they were made, and why.&lt;/p&gt;
&lt;h3 id=&#34;automated-deployment-and-cicd-integration&#34;&gt;Automated deployment and CI/CD integration&lt;/h3&gt;
&lt;p&gt;Teams can streamline their workflow by integrating dashboard updates into their CI/CD pipelines. By pushing changes to GitHub, automated processes can trigger validation checks, test dashboard configurations, and deploy updates programmatically using the &lt;code&gt;grafanactl&lt;/code&gt; CLI and Foundation SDK.&lt;/p&gt;
&lt;p&gt;This reduces the risk of human errors, ensures consistency across environments, and enables a faster, more reliable release cycle for dashboards used in production monitoring and analytics.&lt;/p&gt;
&lt;h3 id=&#34;collaborative-dashboard-development&#34;&gt;Collaborative dashboard development&lt;/h3&gt;
&lt;p&gt;With Git Sync, multiple users can work on dashboards simultaneously without overwriting each other’s modifications.
By leveraging pull requests and branch-based workflows, teams can submit changes for review before merging them into the main branch. This process not only improves quality control but also ensures that dashboards adhere to best practices and organizational standards.&lt;/p&gt;
&lt;p&gt;Additionally, GitHub’s built-in discussion and review tools facilitate effective collaboration, making it easier to address feedback before changes go live.&lt;/p&gt;
&lt;h3 id=&#34;multi-environment-synchronization&#34;&gt;Multi-environment synchronization&lt;/h3&gt;
&lt;p&gt;Enterprises managing multiple Grafana instances, such as development, staging, and production environments, can seamlessly sync dashboards across these instances. This ensures consistency in visualization and monitoring configurations, reducing discrepancies that might arise from manually managing dashboards in different environments.&lt;/p&gt;
&lt;p&gt;By using Git Sync, teams can automate deployments across environments, eliminating repetitive setup tasks and maintaining a standardized monitoring infrastructure across the organization.&lt;/p&gt;
&lt;h3 id=&#34;disaster-recovery-and-backup&#34;&gt;Disaster recovery and backup&lt;/h3&gt;
&lt;p&gt;By continuously syncing dashboards to GitHub, organizations can create an always-updated backup, ensuring dashboards are never lost due to accidental deletion or system failures.&lt;/p&gt;
&lt;p&gt;If an issue arises, such as a corrupted dashboard, unintended modification, or a system crash, teams can quickly restore the latest functional version from the Git repository. This not only minimizes downtime but also adds a layer of resilience to Grafana monitoring setups, ensuring critical dashboards remain available when needed.&lt;/p&gt;
&lt;h2 id=&#34;build-dashboards-as-code&#34;&gt;Build dashboards as code&lt;/h2&gt;
&lt;p&gt;Because dashboards are defined in JSON files, you can enable as-code workflows where the JSON file is an output from Go, TypeScript, or another coding language in the format of a dashboard schema.&lt;/p&gt;
&lt;p&gt;To learn more about creating dashboards in a coding language to provision them for Git Sync, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/foundation-sdk/&#34;&gt;Foundation SDK&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;explore-git-sync&#34;&gt;Explore Git Sync&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/key-concepts/&#34;&gt;Git Sync Key concepts&lt;/a&gt;&lt;br&gt;Key concepts to understand how Git Sync works.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/usage-limits/&#34;&gt;Usage and performance limitations&lt;/a&gt;&lt;br&gt;Git Sync usage tiers, compatible Git providers, and known limitations.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/git-sync-setup/&#34;&gt;Set up Git Sync&lt;/a&gt;&lt;br&gt;Instructions for setting up Git Sync, so you can provision GitHub repositories for use with Grafana.&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/git-sync-setup/set-up-before/&#34;&gt;Setup prerequisites&lt;/a&gt;&lt;br&gt;Prerequisites for Git Sync, so you can provision GitHub repositories for use with Grafana.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/git-sync-setup/set-up-code/&#34;&gt;Set up Git Sync as code&lt;/a&gt;&lt;br&gt;Instructions for setting up Git Sync as code, so you can provision Git repositories for use with Grafana.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/git-sync-setup/set-up-terraform/&#34;&gt;Set up Git Sync with Terraform&lt;/a&gt;&lt;br&gt;Instructions for setting up Git Sync as code, so you can provision Git repositories for use with Grafana.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/git-sync-setup/set-up-extend/&#34;&gt;Instantaneous pulling and dashboard previews&lt;/a&gt;&lt;br&gt;Instructions for extending Git Sync for real-time notification and image rendering.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/export-resources/&#34;&gt;Add non-provisioned resources from Grafana&lt;/a&gt;&lt;br&gt;Export non-provisioned resources from Grafana.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/use-git-sync/&#34;&gt;Work with provisioned repositories in Git Sync&lt;/a&gt;&lt;br&gt;Instructions for working with Git Sync to perform common tasks, such as saving dashboards to GitHub and synchronizing changes with Grafana.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/provisioned-dashboards/&#34;&gt;Work with provisioned dashboards in Git Sync&lt;/a&gt;&lt;br&gt;Update, save, and modify provisioned resources in Grafana using Git Sync.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/scenarios/&#34;&gt;Git Sync deployment scenarios&lt;/a&gt;&lt;br&gt;Learn about common Git Sync deployment patterns and configurations for different organizational needs&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/scenarios/single-instance/&#34;&gt;Single instance Git Sync&lt;/a&gt;&lt;br&gt;Synchronize a single Grafana instance with a Git repository&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/scenarios/dev-prod/&#34;&gt;Git Sync for development and production environments&lt;/a&gt;&lt;br&gt;Use separate Grafana instances for development and production with Git-controlled promotion&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/scenarios/multi-region/&#34;&gt;Git Sync with regional replication&lt;/a&gt;&lt;br&gt;Synchronize multiple regional Grafana instances from a shared Git location&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/scenarios/high-availability/&#34;&gt;Git Sync for high availability environments&lt;/a&gt;&lt;br&gt;Run multiple Grafana instances serving traffic simultaneously, synchronized via Git Sync&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/git-sync/scenarios/multi-team/&#34;&gt;Multiple team Git Sync&lt;/a&gt;&lt;br&gt;Use multiple Git repositories with one Grafana instance, one repository per team&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
]]></content><description>&lt;h1 id="introduction-to-git-sync">Introduction to Git Sync&lt;/h1>
&lt;div class="admonition admonition-caution">&lt;blockquote>&lt;p class="title text-uppercase">Caution&lt;/p>&lt;p>Git Sync is available in &lt;a href="/docs/release-life-cycle/">public preview&lt;/a> for Grafana Cloud, and is an &lt;a href="/docs/release-life-cycle/">experimental feature&lt;/a> in Grafana v12 for open source and Enterprise editions. Documentation and support is available based on the different tiers but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided.&lt;/p></description></item><item><title>Provision resources on-prem</title><link>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/provision-resources/</link><pubDate>Fri, 03 Apr 2026 12:35:46 -0500</pubDate><guid>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/provision-resources/</guid><content><![CDATA[&lt;h1 id=&#34;on-prem-file-provisioning&#34;&gt;On-prem file provisioning&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;On-prem file provisioning is an &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;experimental feature&lt;/a&gt; introduced in Grafana v12 for open source and Enterprise editions available in &lt;a href=&#34;/grafana/download/nightly&#34;&gt;nightly releases&lt;/a&gt;. It&amp;rsquo;s &lt;strong&gt;not available in Grafana Cloud&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;On-prem local file provisioning allows you to configure how to store your dashboard JSON and other files from your local file system. You can set a single folder, or multiple folders to a different repository, with up to 10 connections.&lt;/p&gt;
&lt;p&gt;With on-prem file provisioning:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All provisioned resources are changed in the local files.&lt;/li&gt;
&lt;li&gt;The dashboards saved in your GitHub repository or local folder appear in Grafana in the &amp;lsquo;provisioned&amp;rsquo; folder. The dashboards and folders saved to the local path are referred to as &amp;lsquo;provisioned&amp;rsquo; resources and are labeled as such in the Grafana UI.&lt;/li&gt;
&lt;li&gt;Any changes made in the provisioned files are reflected in the Grafana database. The Grafana UI reads the database and updates the UI to reflect these changes.&lt;/li&gt;
&lt;li&gt;You can&amp;rsquo;t use the Grafana UI to edit or delete provisioned resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;explore-file-provisioning&#34;&gt;Explore file provisioning&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/as-code/observability-as-code/provision-resources/file-path-setup/&#34;&gt;Set up file provisioning&lt;/a&gt;&lt;br&gt;Instructions for setting up file provisioning with a local path.&lt;/li&gt;&lt;/ul&gt;
]]></content><description>&lt;h1 id="on-prem-file-provisioning">On-prem file provisioning&lt;/h1>
&lt;div class="admonition admonition-caution">&lt;blockquote>&lt;p class="title text-uppercase">Caution&lt;/p>&lt;p>On-prem file provisioning is an &lt;a href="/docs/release-life-cycle/">experimental feature&lt;/a> introduced in Grafana v12 for open source and Enterprise editions available in &lt;a href="/grafana/download/nightly">nightly releases&lt;/a>. It&amp;rsquo;s &lt;strong>not available in Grafana Cloud&lt;/strong>.&lt;/p></description></item><item><title>JSON schema v2</title><link>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/schema-v2/</link><pubDate>Fri, 03 Apr 2026 12:35:46 -0500</pubDate><guid>https://grafana.com/docs/grafana/v12.4/as-code/observability-as-code/schema-v2/</guid><content><![CDATA[&lt;h1 id=&#34;dashboard-json-schema-v2&#34;&gt;Dashboard JSON schema v2&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Dashboard JSON schema v2 is a &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;public preview&lt;/a&gt; feature. It is automatically enabled with the Dynamic Dashboards feature toggle. Support is limited to enablement, configuration, and some troubleshooting. Documentation is limited, and SLAs are not available.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Do not enable this feature in production environments as it may result in the irreversible loss of data.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Grafana dashboards are represented as JSON objects that store metadata, panels, variables, and settings.&lt;/p&gt;
&lt;p&gt;Observability as Code works with all versions of the JSON model, and it&amp;rsquo;s fully compatible with version 2.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Schema v2 is automatically enabled with the Dynamic Dashboards feature toggle.
To get early access to this feature, request it through &lt;a href=&#34;https://docs.google.com/forms/d/e/1FAIpQLSd73nQzuhzcHJOrLFK4ef_uMxHAQiPQh1-rsQUT2MRqbeMLpg/viewform?usp=dialog&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;this form&lt;/a&gt;.
It also requires the new dashboards API feature toggle, &lt;code&gt;kubernetesDashboards&lt;/code&gt;, to be enabled as well.&lt;/p&gt;
&lt;p&gt;For more information on how dashboards behave depending on your feature flag configuration, refer to &lt;a href=&#34;#notes-and-limitations&#34;&gt;Notes and limitations&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;accessing-the-json-model&#34;&gt;Accessing the JSON Model&lt;/h2&gt;
&lt;p&gt;To view the JSON representation of a dashboard:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Toggle on the edit mode switch in the top-right corner of the dashboard.&lt;/li&gt;
&lt;li&gt;Click the gear icon in the top navigation bar to go to &lt;strong&gt;Settings&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;JSON Model&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Copy or edit the JSON structure as needed.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;json-fields&#34;&gt;JSON fields&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;annotations&amp;#34;: [],
  &amp;#34;cursorSync&amp;#34;: &amp;#34;Off&amp;#34;,
  &amp;#34;editable&amp;#34;: true,
  &amp;#34;elements&amp;#34;: {},
  &amp;#34;layout&amp;#34;: {
    &amp;#34;kind&amp;#34;: GridLayout, // Can also be AutoGridLayout, RowsLayout, or TabsLayout
    &amp;#34;spec&amp;#34;: {
      &amp;#34;items&amp;#34;: []
    }
  },
  &amp;#34;links&amp;#34;: [],
  &amp;#34;liveNow&amp;#34;: false,
  &amp;#34;preload&amp;#34;: false,
  &amp;#34;tags&amp;#34;: [], // Tags associated with the dashboard.
  &amp;#34;timeSettings&amp;#34;: {
    &amp;#34;autoRefresh&amp;#34;: &amp;#34;&amp;#34;,
    &amp;#34;autoRefreshIntervals&amp;#34;: [
      &amp;#34;5s&amp;#34;,
      &amp;#34;10s&amp;#34;,
      &amp;#34;30s&amp;#34;,
      &amp;#34;1m&amp;#34;,
      &amp;#34;5m&amp;#34;,
      &amp;#34;15m&amp;#34;,
      &amp;#34;30m&amp;#34;,
      &amp;#34;1h&amp;#34;,
      &amp;#34;2h&amp;#34;,
      &amp;#34;1d&amp;#34;
    ],
    &amp;#34;fiscalYearStartMonth&amp;#34;: 0,
    &amp;#34;from&amp;#34;: &amp;#34;now-6h&amp;#34;,
    &amp;#34;hideTimepicker&amp;#34;: false,
    &amp;#34;timezone&amp;#34;: &amp;#34;browser&amp;#34;,
    &amp;#34;to&amp;#34;: &amp;#34;now&amp;#34;
  },
  &amp;#34;title&amp;#34;: &amp;#34;&amp;#34;,
  &amp;#34;variables&amp;#34;: []
},&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The dashboard JSON sample shown uses the default &lt;code&gt;GridLayoutKind&lt;/code&gt;.
The JSON in a new dashboard for the other three layout options, &lt;code&gt;AutoGridLayout&lt;/code&gt;, &lt;code&gt;RowsLayout&lt;/code&gt;, and &lt;code&gt;TabsLayout&lt;/code&gt;, are as follows:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;AutoGridLayout&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;  &amp;#34;layout&amp;#34;: {
    &amp;#34;kind&amp;#34;: &amp;#34;AutoGridLayout&amp;#34;,
    &amp;#34;spec&amp;#34;: {
      &amp;#34;columnWidthMode&amp;#34;: &amp;#34;standard&amp;#34;,
      &amp;#34;items&amp;#34;: [],
      &amp;#34;fillScreen&amp;#34;: false,
      &amp;#34;maxColumnCount&amp;#34;: 3,
      &amp;#34;rowHeightMode&amp;#34;: &amp;#34;standard&amp;#34;
    }
  },&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;RowsLayout&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;  &amp;#34;layout&amp;#34;: {
    &amp;#34;kind&amp;#34;: &amp;#34;RowsLayout&amp;#34;,
    &amp;#34;spec&amp;#34;: {
      &amp;#34;rows&amp;#34;: []
  },&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;TabsLayout&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;  &amp;#34;layout&amp;#34;: {
    &amp;#34;kind&amp;#34;: &amp;#34;TabsLayout&amp;#34;,
    &amp;#34;spec&amp;#34;: {
      &amp;#34;tabs&amp;#34;: []
  },&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;dashboardspec&#34;&gt;&lt;code&gt;DashboardSpec&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The following table explains the usage of the dashboard JSON fields.
The table includes default and other fields:&lt;/p&gt;
&lt;!-- prettier-ignore-start --&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Usage&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;annotations&lt;/td&gt;
              &lt;td&gt;Contains the list of annotations that are associated with the dashboard.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;cursorSync&lt;/td&gt;
              &lt;td&gt;Dashboard cursor sync behavior.&lt;ul&gt;&lt;li&gt;&lt;code&gt;Off&lt;/code&gt; - No shared crosshair or tooltip (default)&lt;/li&gt;&lt;li&gt;&lt;code&gt;Crosshair&lt;/code&gt; - Shared crosshair&lt;/li&gt;&lt;li&gt;&lt;code&gt;Tooltip&lt;/code&gt; - Shared crosshair and shared tooltip&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;editable&lt;/td&gt;
              &lt;td&gt;bool. Whether or not a dashboard is editable.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;elements&lt;/td&gt;
              &lt;td&gt;Contains the list of elements included in the dashboard. Supported dashboard elements are: PanelKind and LibraryPanelKind.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;layout&lt;/td&gt;
              &lt;td&gt;The dashboard layout. Supported layouts are:&lt;ul&gt;&lt;li&gt;GridLayoutKind&lt;/li&gt;&lt;li&gt;AutoGridLayoutKind&lt;/li&gt;&lt;li&gt;RowsLayoutKind&lt;/li&gt;&lt;li&gt;TabsLayoutKind&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;links&lt;/td&gt;
              &lt;td&gt;Links with references to other dashboards or external websites.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;liveNow&lt;/td&gt;
              &lt;td&gt;bool. When set to &lt;code&gt;true&lt;/code&gt;, the dashboard redraws panels at an interval matching the pixel width. This keeps data &amp;ldquo;moving left&amp;rdquo; regardless of the query refresh rate. This setting helps avoid dashboards presenting stale live data.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;preload&lt;/td&gt;
              &lt;td&gt;bool. When set to &lt;code&gt;true&lt;/code&gt;, the dashboard loads all panels when the dashboard is loaded.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;tags&lt;/td&gt;
              &lt;td&gt;Contains the list of tags associated with dashboard.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;timeSettings&lt;/td&gt;
              &lt;td&gt;All time settings for the dashboard.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;title&lt;/td&gt;
              &lt;td&gt;Title of the dashboard.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;variables&lt;/td&gt;
              &lt;td&gt;Contains the list of configured template variables.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;!-- prettier-ignore-end --&gt;
&lt;h3 id=&#34;annotations&#34;&gt;&lt;code&gt;annotations&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The configuration for the list of annotations that are associated with the dashboard.
For the JSON and field usage notes, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/annotations-schema/&#34;&gt;annotations schema documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;elements&#34;&gt;&lt;code&gt;elements&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Dashboards can contain the following elements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/panel-schema/&#34;&gt;PanelKind&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/librarypanel-schema/&#34;&gt;LibraryPanelKind&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;layout&#34;&gt;&lt;code&gt;layout&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Dashboards can have four layout options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/layout-schema/#gridlayoutkind&#34;&gt;GridLayoutKind&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/layout-schema/#autogridlayoutkind&#34;&gt;AutoGridLayoutKind&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/layout-schema/#rowslayoutkind&#34;&gt;RowsLayoutKind&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/layout-schema/#tabslayoutkind&#34;&gt;TabsLayoutKind&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the JSON and field usage notes about each of these, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/layout-schema/&#34;&gt;layout schema documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;links&#34;&gt;&lt;code&gt;links&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The configuration for links with references to other dashboards or external websites.&lt;/p&gt;
&lt;p&gt;For the JSON and field usage notes, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/links-schema/&#34;&gt;links schema documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;tags&#34;&gt;&lt;code&gt;tags&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Tags associated with the dashboard. Each tag can be up to 50 characters long.&lt;/p&gt;
&lt;p&gt;&lt;code&gt; [...string]&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;timesettings&#34;&gt;&lt;code&gt;timesettings&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;TimeSettingsSpec&lt;/code&gt; defines the default time configuration for the time picker and the refresh picker for the specific dashboard.
For the JSON and field usage notes about the &lt;code&gt;TimeSettingsSpec&lt;/code&gt;, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/timesettings-schema/&#34;&gt;timesettings schema documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;variables&#34;&gt;&lt;code&gt;variables&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;variables&lt;/code&gt; schema defines which variables are used in the dashboard.&lt;/p&gt;
&lt;p&gt;There are eight variables types:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;QueryVariableKind&lt;/li&gt;
&lt;li&gt;TextVariableKind&lt;/li&gt;
&lt;li&gt;ConstantVariableKind&lt;/li&gt;
&lt;li&gt;DatasourceVariableKind&lt;/li&gt;
&lt;li&gt;IntervalVariableKind&lt;/li&gt;
&lt;li&gt;CustomVariableKind&lt;/li&gt;
&lt;li&gt;GroupByVariableKind&lt;/li&gt;
&lt;li&gt;AdhocVariableKind&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the JSON and field usage notes about the &lt;code&gt;variables&lt;/code&gt; spec, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/observability-as-code/schema-v2/variables-schema/&#34;&gt;variables schema documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;notes-and-limitations&#34;&gt;Notes and limitations&lt;/h2&gt;
&lt;h3 id=&#34;existing-dashboards&#34;&gt;Existing dashboards&lt;/h3&gt;
&lt;p&gt;With schema v2 enabled, you can still open and view your pre-existing dashboards.
Upon saving, they’ll be updated to the new schema where you can take advantage of the new features and functionalities.&lt;/p&gt;
&lt;h3 id=&#34;dashboard-behavior-with-disabled-feature-flags&#34;&gt;Dashboard behavior with disabled feature flags&lt;/h3&gt;
&lt;p&gt;If you disable the Dynamic dashboards or &lt;code&gt;kubernetesDashboards&lt;/code&gt; feature flags, you should be aware of how dashboards will behave.&lt;/p&gt;
&lt;h4 id=&#34;disable-dynamic-dashboards&#34;&gt;Disable Dynamic dashboards&lt;/h4&gt;
&lt;p&gt;If the Dynamic dashboards feature toggle is disabled, depending on how the dashboard was built, it will behave differently:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dashboards built on the new schema through the UI - View only&lt;/li&gt;
&lt;li&gt;Dashboards built on Schema v1 - View and edit&lt;/li&gt;
&lt;li&gt;Dashboards built on the new schema by way of Terraform or the CLI - View and edit&lt;/li&gt;
&lt;li&gt;Provisioned dashboards built on the new schema - View and edit, but the edit experience will be the old experience&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;disable-dynamic-dashboards-and-kubernetesdashboards&#34;&gt;Disable Dynamic dashboards and &lt;code&gt;kubernetesDashboards&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;You’ll be unable to view or edit dashboards created or updated in the new schema.&lt;/p&gt;
&lt;h3 id=&#34;import-and-export&#34;&gt;Import and export&lt;/h3&gt;
&lt;p&gt;From the UI, dashboards created on schema v2 can be exported and imported like other dashboards.
When you export them to use in another instance, references of data sources are not persisted but data source types are.
You’ll have the option to select the data source of your choice in the import UI.&lt;/p&gt;
]]></content><description>&lt;h1 id="dashboard-json-schema-v2">Dashboard JSON schema v2&lt;/h1>
&lt;div class="admonition admonition-caution">&lt;blockquote>&lt;p class="title text-uppercase">Caution&lt;/p>&lt;p>Dashboard JSON schema v2 is a &lt;a href="/docs/release-life-cycle/">public preview&lt;/a> feature. It is automatically enabled with the Dynamic Dashboards feature toggle. Support is limited to enablement, configuration, and some troubleshooting. Documentation is limited, and SLAs are not available.&lt;/p></description></item></channel></rss>