This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.

Documentationbreadcrumb arrow Grafana documentationbreadcrumb arrow As code and provisioning
Enterprise Open source Grafana Cloud

Deploy, provision and manage Grafana with as code workflows

Manage resources, including folders and dashboards, and configurations with as code workflows.

Note

Looking for gcx? Have a look at the new AI tools section!

Overview of as code and provisioning

Provisioning and as code let you apply code management best practices to your observability resources. By representing Grafana resources as code, you can integrate them into existing infrastructure-as-code workflows and apply standard development practices. Instead of manually configuring dashboards or settings through the Grafana UI, you can:

  • Write configurations in code: Define dashboards in JSON or other supported formats.
  • Sync your Grafana setup to GitHub: Track changes, collaborate, and roll back updates using Git and GitHub, or other remote sources.
  • Automate with CI/CD: Integrate Grafana directly into your development and deployment pipelines.
  • Standardize workflows: Ensure consistency across your teams by using repeatable, codified processes for managing Grafana resources.

Note

For basic configuration provisioning refer to Provision Grafana.

Explore

Explore the available as code tools. Most can be used with one another.

A new approach

Historically, managing Grafana as code involved various community and Grafana Labs tools, but lacked a single, cohesive story. Grafana 12 introduces foundational improvements, including new versioned APIs and official tooling, to provide a clearer path forward:

  • This approach requires handling HTTP requests and responses but provides complete control over resource management.
  • gcx, Git Sync, and the Foundation SDK are all built on top of these APIs.
  • To understand Dashboard Schemas accepted by the APIs, refer to the JSON models documentation.

In Grafana Cloud, you can create and manage dashboards via configuration files in source code, and incorporate them efficiently into your own use cases. This enables you to review code, reuse it, and create better workflows. Infrastructure as code tools include Terraform, Ansible, the Grafana Operator, and Grizzly.

as code for Kubernetes: Grafana Operator and Grafana Crossplane provider

The Grafana Operator is a Kubernetes operator that can provision, manage, and operate Grafana instances and their associated resources within Kubernetes through Custom Resources. The Operator eases the administration of Grafana, including managing dashboards, data sources, and folders. To get started, refer to the quickstart guides for the Grafana Operator or check out the Grafana Operator’s documentation.

For Grafana Crossplane, refer to Use the Grafana Crossplane provider.

Additional as code tools

Grafonnet is a Jsonnet library for generating Grafana dashboard JSON definitions programmatically. Grafonnet is not officially supported by Grafana. Instead, use the Foundation SDK to create dashboards as code.

Grizzly has been removed, and is no longer deployed, enhanced, or supported. Use the Grafana CLI instead.