Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/grafana-cloud/as-code/observability-as-code.md (append .md) or send Accept: text/markdown to /docs/grafana-cloud/as-code/observability-as-code/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/llms-full.txt.
Observability as Code
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.
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.
Explore
gcx) 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’s suitable for CI/CD pipelines, local development, or free-form tasks.gcx to push your programmatically generated resources.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 (deprecated) is a Jsonnet library for generating Grafana dashboard JSON definitions programmatically.
Was this page helpful?
Related resources from Grafana Labs


