Enterprise Open source Grafana Cloud

Observability as Code

Using Observability as Code, you can version, automate, and scale Grafana configurations, including dashboards and observability workflows.

Overview

Grafana provides a suite of tools for Observability as code to help you manage your Grafana resources programmatically and at scale. This approach lets you define dashboards, data sources, and other configurations in code, enabling version control, automated testing, and reliable deployments through CI/CD pipelines. You can apply code management best practices to your observability resources, and integrate them into existing infrastructure-as-code workflows.

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.
  • grafanactl, 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.

Explore

Additional Observability as code tools

If you’re already using established Infrastructure as code or other configuration management tools, Grafana offers integrations to manage resources within your existing workflows.

  • Terraform
    • Use the Grafana Terraform provider to manage dashboards, alerts, and more.
    • Understand how to define and deploy resources using HCL/JSON configurations.
  • Ansible
    • Learn to use the Grafana Ansible collection to manage Grafana Cloud resources, including folders and cloud stacks.
    • Write playbooks to automate resource provisioning through the Grafana API.
  • Grafana Operator
    • Utilize Kubernetes-native management with the Grafana Operator.
    • Manage dashboards, folders, and data sources via Kubernetes Custom Resources.
    • Integrate with GitOps workflows for seamless version control and deployment.
  • Crossplane lets you manage Grafana resources using Kubernetes manifests with the Grafana Crossplane provider.
  • Grafonnet is a Jsonnet library for generating Grafana dashboard JSON definitions programmatically.