From gcx
Imports Grafana dashboards from a live instance into Go builder code via gcx dev import. Converts JSON to grafana-foundation-sdk manifests for code-as-config migration.
npx claudepluginhub grafana/gcx --plugin gcxThis skill uses the workspace's default tool permissions.
Import existing dashboards from a Grafana instance and convert them to Go
Scaffolds new Go projects for Grafana resources-as-code using gcx dev scaffold. Generates repo structure with CI/CD, main.go, and dashboard examples. Triggers on 'new project', 'scaffold', 'get started with gcx'.
Generates Grafana dashboards and configurations for DevOps monitoring tasks involving Kubernetes, Terraform, Helm, and IaC. Provides step-by-step guidance, best practices, and production-ready outputs.
Builds production-ready Grafana dashboards with panels, template variables, annotations, and provisioning for Prometheus/Loki metrics. Use for SRE operational views, SLO reporting, or version-controlled deployments.
Share bugs, ideas, or general feedback.
Import existing dashboards from a Grafana instance and convert them to Go
builder code using gcx dev import.
gcx config check should show a valid context)gcx dev import dashboards
Writes Go files to imported/ (default). Each dashboard becomes a function
returning *resource.ManifestBuilder.
gcx dev import dashboards/my-dashboard-uid
gcx dev import dashboards --path src/grafana
gcx dev import dashboards folders
Grafana Instance
│
▼
gcx dev import dashboards/foo
│
├── 1. Fetches resource via K8s API (/apis endpoint)
├── 2. Detects API version (v0alpha1, v1beta1, v2beta1)
├── 3. Runs version-specific converter (JSON → SDK builder code)
├── 4. Wraps in resource.NewManifestBuilder()
└── 5. Writes to imported/<snake_case_name>.go
The converter produces Go code using the grafana-foundation-sdk builder
pattern — the same pattern used by dev generate and dev scaffold.
Each imported file looks like:
package dashboards
import (
"github.com/grafana/grafana-foundation-sdk/go/dashboardv2beta1"
"github.com/grafana/grafana-foundation-sdk/go/resource"
)
func MyDashboard() *resource.ManifestBuilder {
// ... builder code generated from the live dashboard
}
# 1. Import from Grafana
gcx dev import dashboards --path internal/dashboards
# 2. Review and edit the generated code
# (fix up builder calls, add variables, etc.)
# 3. Push back to Grafana
gcx resources push
| Issue | Fix |
|---|---|
| "no converter found" | Dashboard uses an unsupported API version; only v0alpha1, v1beta1, v2beta1 supported |
| Auth error (401/403) | Run gcx config check to verify credentials |
| Empty import | The selector matched no resources; check UID with gcx resources get dashboards |
| Imported code doesn't compile | Some complex dashboards produce converter output that needs manual fixup |