<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Deploy, configure and provision Grafana with as code workflows on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.3/as-code/</link><description>Recent content in Deploy, configure and provision Grafana with as code workflows on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v13.3/as-code/index.xml" rel="self" type="application/rss+xml"/><item><title>Introduction to Git Sync</title><link>https://grafana.com/docs/grafana/v13.3/as-code/git-sync/</link><pubDate>Wed, 28 Oct 2026 09:22:36 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/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;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;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;Git Sync functionalities are constantly evolving. &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;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, so 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;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/ascode/gitsync-architecture.png&#34;
  alt=&#34;Git Sync architecture&#34; width=&#34;1408&#34;
     height=&#34;768&#34;/&gt;&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, GitHub Enterprise, GitLab and Bitbucket. Refer to 
    &lt;a href=&#34;/docs/grafana/v13.3/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/v13.3/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/v13.3/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/v13.3/as-code/git-sync/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;gcx&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/v13.3/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;p&gt;Refer to the following documents to learn about Git Sync in depth:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/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/v13.3/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/v13.3/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/v13.3/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/v13.3/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/v13.3/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/v13.3/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/v13.3/as-code/git-sync/add-resources/&#34;&gt;Add non-provisioned resources from Grafana&lt;/a&gt;&lt;br&gt;Export non-provisioned resources from Grafana.&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/git-sync/add-resources/dashboards-copy/&#34;&gt;Cherry-pick and copy individual dashboards&lt;/a&gt;&lt;br&gt;Cherry-pick and copy individual dashboards.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/git-sync/add-resources/dashboards-migrate/&#34;&gt;Migrate existing dashboards to Git Sync&lt;/a&gt;&lt;br&gt;Migrate existing dashboards to Git Sync.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/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/v13.3/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/v13.3/as-code/git-sync/permissions-grafana/&#34;&gt;Git Sync permissions and access control&lt;/a&gt;&lt;br&gt;Learn about permissions and access control for Git Sync, including required Grafana roles and repository permissions.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/git-sync/permissions-git/&#34;&gt;Configure Git repository protection&lt;/a&gt;&lt;br&gt;Learn how to protect your Git repository and control who can read or write dashboard source code when using Git Sync.&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/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/v13.3/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/v13.3/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/v13.3/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/v13.3/as-code/git-sync/scenarios/testing-sandboxes/&#34;&gt;Testing sandboxes Git Sync&lt;/a&gt;&lt;br&gt;Use a shared sandbox branch for short-lived projects and experimentation before promoting changes to the main branch&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/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/v13.3/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;p>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></description></item><item><title>Provision resources on-prem</title><link>https://grafana.com/docs/grafana/v13.3/as-code/provision-resources/</link><pubDate>Wed, 28 Oct 2026 09:22:36 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/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-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;On-prem file provisioning is available in Grafana v12 and later for open source and Enterprise editions. It&amp;rsquo;s &lt;strong&gt;not available in Grafana Cloud&lt;/strong&gt;. This new file provisioning feature is only available for dashboards and doesn&amp;rsquo;t replace classic provisioning for the time being.&lt;/p&gt;
&lt;p&gt;For classic provisioning using configuration files refer to 
    &lt;a href=&#34;/docs/grafana/v13.3/administration/provisioning/&#34;&gt;Provision Grafana&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;On-prem local file provisioning allows you to add resources that are stored in your local file system to your Grafana instance. You can
configure how to save your dashboards&amp;rsquo; JSON and other files from your local file system into a single or multiple folders in a different repository, with up to 10 connections.&lt;/p&gt;
&lt;p&gt;You can set it up 
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/provision-resources/file-path-setup/#set-up-file-provisioning-using-the-ui&#34;&gt;using the UI&lt;/a&gt; or 
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/provision-resources/file-path-setup/#set-up-file-provisioning-as-code&#34;&gt;as code&lt;/a&gt; with the Grafana CLI. Refer to 
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/provision-resources/file-path-setup/&#34;&gt;Set up file provisioning&lt;/a&gt; for details.&lt;/p&gt;
&lt;p&gt;File provisioning uses the same &lt;code&gt;Repository&lt;/code&gt; resource as Git Sync, with the repository &lt;code&gt;type&lt;/code&gt; set to &lt;code&gt;local&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;how-it-works&#34;&gt;How it works&lt;/h2&gt;
&lt;p&gt;On-prem file provisioning is only available for dashboards at the moment.&lt;/p&gt;
&lt;p&gt;After setting up file provisioning:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The dashboards saved in your GitHub repository or local folder appear in Grafana in the &lt;code&gt;provisioned&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;The dashboards and folders saved to the local path are referred to as &lt;code&gt;provisioned&lt;/code&gt; resources and are labeled as such in the Grafana UI.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can only modify provisioned dashboards locally.&lt;/p&gt;
&lt;ul&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;
]]></content><description>&lt;h1 id="on-prem-file-provisioning">On-prem file provisioning&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>On-prem file provisioning is available in Grafana v12 and later for open source and Enterprise editions. It&amp;rsquo;s &lt;strong>not available in Grafana Cloud&lt;/strong>. This new file provisioning feature is only available for dashboards and doesn&amp;rsquo;t replace classic provisioning for the time being.&lt;/p></description></item><item><title>Grafana Terraform provider</title><link>https://grafana.com/docs/grafana/v13.3/as-code/terraform/</link><pubDate>Wed, 28 Oct 2026 09:22:36 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/as-code/terraform/</guid><content><![CDATA[&lt;h1 id=&#34;grafana-terraform-provider&#34;&gt;Grafana Terraform provider&lt;/h1&gt;
&lt;p&gt;The &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Terraform provider&lt;/a&gt; provisions configuration management resources for Grafana. Grafana administrators can manage dashboards, data sources, plugins, alerts and collectors, add synthetic monitoring probes and checks, manage identity and access, and more, using the Terraform provider.&lt;/p&gt;
&lt;p&gt;To manage the entire Grafana ecosystem of resources on either Grafana Cloud or OSS deployments of Grafana, it’s best to use the Terraform Grafana provider because it supports the most Grafana resources compared to Grafana’s other as-code solutions.&lt;/p&gt;
&lt;p&gt;The following guides help you get started using Terraform to manage your Grafana Cloud stack:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;terraform-cloud-stack/&#34;&gt;Create and manage a Grafana Cloud stack using Terraform&lt;/a&gt;: Learn how to create a Grafana Cloud stack and add a data source and dashboard using Terraform.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;dashboards-github-action/&#34;&gt;Create and manage dashboards using Terraform and GitHub Actions&lt;/a&gt;: Learn how to create and manage multiple dashboards represented as JSON source code for Grafana using Terraform and GitHub Actions.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;terraform-oncall/&#34;&gt;Managing IRM on Grafana Cloud using Terraform&lt;/a&gt;: Learn how to connect an integration to Grafana IRM, configure escalation policies, and add your on-call schedule using Terraform.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/as-code/terraform/terraform-fleet-management/&#34;&gt;Managing Fleet Management in Grafana Cloud using Terraform&lt;/a&gt;: Learn how to create collectors and pipelines in Grafana Fleet Management using Terraform. For Grafana Fleet Management users, the Grafana Terraform provider is best used to preregister new collectors before they are operational or add remote attributes to collectors already registered with the service.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/as-code/terraform/terraform-frontend-observability/&#34;&gt;Managing Frontend Observability in Grafana Cloud using Terraform&lt;/a&gt;: Learn how to manage resources in Frontend Observability using Terraform.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;terraform-cloud-provider-o11y/&#34;&gt;Manage Cloud Provider Observability in Grafana Cloud using Terraform&lt;/a&gt;: Learn how to manage Amazon CloudWatch and Microsoft Azure resources in Cloud Provider Observability using Terraform.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;terraform-knowledge-graph/&#34;&gt;Manage Knowledge Graph in Grafana Cloud using Terraform&lt;/a&gt;: Learn how to create and manage notification alerts, suppressed assertions, custom model rules, log, trace, and profile configurations, threshold configurations, and Prometheus rules in Grafana Cloud Knowledge Graph using Terraform.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;terraform-plugins&#34;&gt;Install plugins in Grafana Cloud using Terraform&lt;/a&gt;: Learn how to install plugins in Grafana Cloud using Terraform.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;manage-saved-queries/&#34;&gt;Manage saved queries using Terraform&lt;/a&gt;: Learn how to create and import saved queries, also known as the query library, using Terraform.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;terraform-secrets-management/&#34;&gt;Manage secrets in Grafana Cloud using Terraform&lt;/a&gt;: Learn how to create, rotate, and manage secure values in Grafana Secrets Management using Terraform.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="grafana-terraform-provider">Grafana Terraform provider&lt;/h1>
&lt;p>The &lt;a href="https://registry.terraform.io/providers/grafana/grafana/latest" target="_blank" rel="noopener noreferrer">Grafana Terraform provider&lt;/a> provisions configuration management resources for Grafana. Grafana administrators can manage dashboards, data sources, plugins, alerts and collectors, add synthetic monitoring probes and checks, manage identity and access, and more, using the Terraform provider.&lt;/p></description></item><item><title>Grafana Ansible collection</title><link>https://grafana.com/docs/grafana/v13.3/as-code/ansible/</link><pubDate>Wed, 28 Oct 2026 09:22:36 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/as-code/ansible/</guid><content><![CDATA[&lt;h1 id=&#34;grafana-ansible-collection&#34;&gt;Grafana Ansible collection&lt;/h1&gt;
&lt;p&gt;The &lt;a href=&#34;https://docs.ansible.com/ansible/latest/collections/grafana/grafana/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Ansible collection&lt;/a&gt; provides configuration management resources for Grafana Cloud. You can use it to manage:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Grafana Cloud stacks&lt;/li&gt;
&lt;li&gt;Dashboards&lt;/li&gt;
&lt;li&gt;Data sources&lt;/li&gt;
&lt;li&gt;Folders&lt;/li&gt;
&lt;li&gt;Alerting contact points&lt;/li&gt;
&lt;li&gt;Notification policies&lt;/li&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If your resources aren&amp;rsquo;t currently available in the Grafana Ansible collection, you can manage them on Grafana Cloud programmatically by writing Ansible playbooks that use the &lt;a href=&#34;https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Ansible built-in URI module&lt;/a&gt; to call the 
    &lt;a href=&#34;/docs/grafana/v13.3/developer-resources/api-reference/http-api/&#34;&gt;HTTP APIs&lt;/a&gt; to manage resources for the Grafana Cloud portal, as well as those within a stack.&lt;/p&gt;
&lt;h2 id=&#34;learn-more&#34;&gt;Learn more&lt;/h2&gt;
&lt;p&gt;Refer to &lt;a href=&#34;ansible-cloud-stack/&#34;&gt;Create and manage a Grafana Cloud stack using Ansible&lt;/a&gt; to learn how to create a Grafana Cloud stack and add a data source and dashboard using &lt;a href=&#34;https://www.ansible.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Ansible&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To learn more about managing Grafana with Infrastructure as code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.ansible.com/ansible/latest/collections/grafana/grafana/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Ansible collection documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Ansible playbook best practices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/developer-resources/api-reference/http-api/&#34;&gt;Grafana API documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/grafana-cloud/developer-resources/api-reference/&#34;&gt;Grafana Cloud API documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/terraform/&#34;&gt;Infrastructure as Code with Terraform&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;grafana-agent-deprecated&#34;&gt;Grafana Agent (deprecated)&lt;/h2&gt;


&lt;div data-shared=&#34;agent-deprecation.md&#34;&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;Grafana Alloy is the new name for our distribution of the OTel collector.
Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025.
Read more about why we recommend migrating to &lt;a href=&#34;/blog/2024/04/09/grafana-alloy-opentelemetry-collector-with-prometheus-pipelines/&#34;&gt;Grafana Alloy&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/div&gt;

        
&lt;p&gt;The Ansible collection also houses &lt;a href=&#34;https://github.com/grafana/grafana-ansible-collection/tree/main/roles/grafana_agent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Agent role&lt;/a&gt;, which is now deprecated.&lt;/p&gt;
]]></content><description>&lt;h1 id="grafana-ansible-collection">Grafana Ansible collection&lt;/h1>
&lt;p>The &lt;a href="https://docs.ansible.com/ansible/latest/collections/grafana/grafana/" target="_blank" rel="noopener noreferrer">Grafana Ansible collection&lt;/a> provides configuration management resources for Grafana Cloud. You can use it to manage:&lt;/p>
&lt;ul>
&lt;li>Grafana Cloud stacks&lt;/li>
&lt;li>Dashboards&lt;/li>
&lt;li>Data sources&lt;/li>
&lt;li>Folders&lt;/li>
&lt;li>Alerting contact points&lt;/li>
&lt;li>Notification policies&lt;/li>
&lt;li>API keys&lt;/li>
&lt;/ul>
&lt;p>If your resources aren&amp;rsquo;t currently available in the Grafana Ansible collection, you can manage them on Grafana Cloud programmatically by writing Ansible playbooks that use the &lt;a href="https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html" target="_blank" rel="noopener noreferrer">Ansible built-in URI module&lt;/a> to call the
&lt;a href="/docs/grafana/v13.3/developer-resources/api-reference/http-api/">HTTP APIs&lt;/a> to manage resources for the Grafana Cloud portal, as well as those within a stack.&lt;/p></description></item><item><title>Grafana Operator</title><link>https://grafana.com/docs/grafana/v13.3/as-code/grafana-operator/</link><pubDate>Wed, 28 Oct 2026 09:22:36 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/as-code/grafana-operator/</guid><content><![CDATA[&lt;h1 id=&#34;grafana-operator&#34;&gt;Grafana Operator&lt;/h1&gt;
&lt;p&gt;The &lt;a href=&#34;https://grafana.github.io/grafana-operator/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Operator&lt;/a&gt; is a Kubernetes operator built to help you manage your Grafana instances and its resources in a Kubernetes environment. The Grafana Operator automatically syncs Kubernetes custom resources and actual resources in your Grafana instance, and allows you to install and manage local Grafana instances, dashboards and data sources in Kubernetes or OpenShift.&lt;/p&gt;
&lt;p&gt;While the Grafana Operator simplifies many aspects of operating Grafana and its resources on Kubernetes, its current support is mainly focused on managing dashboards, folders, and data sources. Advanced features like alerting and plugins (only works for OSS) are not supported yet.&lt;/p&gt;
&lt;h2 id=&#34;install-the-grafana-operator&#34;&gt;Install the Grafana Operator&lt;/h2&gt;
&lt;p&gt;To install the Grafana Operator in your Kubernetes cluster, run the following command in your terminal:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&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&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;helm repo add grafana https://grafana.github.io/helm-charts
helm upgrade -i grafana-operator grafana/grafana-operator&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For other installation methods, refer to the &lt;a href=&#34;https://grafana.github.io/grafana-operator/docs/installation/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Operator Installation&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;use-the-grafana-operator&#34;&gt;Use the Grafana Operator&lt;/h2&gt;
&lt;p&gt;Use the following guides to use the Grafana Operator to manage your Grafana instance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/grafana-operator/operator-dashboards-folders-datasources/&#34;&gt;Manage data sources, and dashboards with folders using the Grafana Operator&lt;/a&gt; describes how to add a folders, data sources, and dashboards using the Grafana Operator.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/grafana-operator/manage-dashboards-argocd/&#34;&gt;Manage Dashboards with GitOps Using ArgoCD&lt;/a&gt; describes how to create and manage dashboards using ArgoCD and Grafana Operator.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;use-the-grafana-crossplane-provider&#34;&gt;Use the Grafana Crossplane provider&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;The Grafana Crossplane provider is intended for existing Crossplane users looking to manage Grafana resources from within Kubernetes and as Kubernetes manifests for the GitOps pipelines. To use the Crossplane provider, you must have the Crossplane CLI and Crossplane installed in the Kubernetes cluster. Note that the Crossplane provider is in an alpha stage, so it has not reached a stable state yet.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href=&#34;https://github.com/grafana/crossplane-provider-grafana&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Crossplane provider&lt;/a&gt; is built using Terrajet and provides support for all resources supported by the Grafana Terraform provider. It enables you to define Grafana resources as Kubernetes manifests and it also help users who build their GitOps pipelines around Kubernetes manifests using tools like ArgoCD.&lt;/p&gt;
&lt;p&gt;To get started with the Grafana Crossplane provider, install Crossplane in the Kubernetes cluster and use this command to install the provider:&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;shell&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-shell&#34;&gt;kubectl crossplane install provider grafana/crossplane-provider-grafana:v0.1.0&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;During installation of the provider, CRDs for all the resources supported by the Terraform provider are added to the cluster so users can begin defining their Grafana resources as Kubernetes custom resources. The Crossplane provider ensures that whatever is defined in the custom resource definitions is what is visible in Grafana UI. If you make any changes directly in the UI, the changes will be discarded when the provider syncs again. This helps ensure that whatever is defined via code in the cluster will be the source of truth for Grafana resources.&lt;/p&gt;
&lt;p&gt;For more information, refer to the examples folder in the Grafana Crossplane repository.&lt;/p&gt;
]]></content><description>&lt;h1 id="grafana-operator">Grafana Operator&lt;/h1>
&lt;p>The &lt;a href="https://grafana.github.io/grafana-operator/" target="_blank" rel="noopener noreferrer">Grafana Operator&lt;/a> is a Kubernetes operator built to help you manage your Grafana instances and its resources in a Kubernetes environment. The Grafana Operator automatically syncs Kubernetes custom resources and actual resources in your Grafana instance, and allows you to install and manage local Grafana instances, dashboards and data sources in Kubernetes or OpenShift.&lt;/p></description></item><item><title>Foundation SDK</title><link>https://grafana.com/docs/grafana/v13.3/as-code/foundation-sdk/</link><pubDate>Wed, 28 Oct 2026 09:22:36 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/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 Grafana Foundation SDK 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. Refer to 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; GitHub repository for further details.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/_OKQoABmg0Q&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&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;Composable builder pattern:&lt;/strong&gt; You can chain different builder blocks to 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;Safe 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;Configuration with 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, predictable, and easy to 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;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/foundation-sdk/foundation-sdk-key-concepts/&#34;&gt;Foundation SDK key concepts&lt;/a&gt; for a more extensive explanation, and read on to see these concepts in action.&lt;/p&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 (Grafana v10.0 or higher).&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;h2 id=&#34;install-the-grafana-foundation-sdk&#34;&gt;Install the Grafana Foundation SDK&lt;/h2&gt;
&lt;p&gt;To install the Foundation SDK:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;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;/li&gt;
&lt;li&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 &lt;a href=&#34;https://grafana.github.io/grafana-foundation-sdk/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Foundation SDK documentation&lt;/a&gt; for installation instructions.&lt;/li&gt;
&lt;/ol&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;Go&#34;&gt;Go&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;typescript&#34;&gt;typescript&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#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@latest&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;h2 id=&#34;create-a-dashboard&#34;&gt;Create a dashboard&lt;/h2&gt;
&lt;p&gt;See the following examples in Go and Typescript to create a simple dashboard:&lt;/p&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;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;Go&#34;&gt;Go&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;typescript&#34;&gt;typescript&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#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;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 the 
    &lt;a href=&#34;/docs/grafana/v13.3/developer-resources/api-reference/http-api/&#34;&gt;Grafana API&lt;/a&gt;, the 
    &lt;a href=&#34;/docs/grafana/v13.3/ai-tools/grafana-cli/&#34;&gt;Grafana CLI&lt;/a&gt;, or 
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/git-sync/&#34;&gt;Git Sync&lt;/a&gt; to programmatically upload the dashboard JSON.&lt;/li&gt;
&lt;/ul&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;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/ZjWdGVsrCiQ&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&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;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;li&gt;&lt;strong&gt;Learn about 
    &lt;a href=&#34;/docs/grafana/v13.3/as-code/git-sync/&#34;&gt;Grafana Git Sync&lt;/a&gt;&lt;/strong&gt;, which lets you synchronize your resources so you can store your dashboards as JSON files stored in GitHub and manage them as code.&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 Grafana Foundation SDK 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></channel></rss>