Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 1.53 KB

File metadata and controls

29 lines (26 loc) · 1.53 KB
title Dashboards as code

With this workflow, you can define and manage dashboards as code, saving them to a version control system like Git. This is useful for teams that want to maintain a history of changes, collaborate on dashboard design, and ensure consistency across environments.

!!! note In order to use gcx dev serve functionality, you will have to enable a feature toggle in your config.ini: ini [feature_toggles] kubernetesDashboards = true Check the documentation to learn more about enabling feature toggles.

  1. Use a dashboard generation script (for example, with the Foundation SDK). You can find an example implementation in the Grafana as code hands-on lab repository.
  2. Serve and preview the output of the dashboard generator locally:
    gcx config use-context YOUR_CONTEXT  # for example "dev"
    gcx dev serve --script 'go run scripts/generate-dashboard.go' --watch './scripts'
  3. When the output looks correct, generate dashboard manifest files:
    go run scripts/generate-dashboard.go --generate-resource-manifests --output './resources'
  4. Push the generated resources to your Grafana instance:
    gcx config use-context YOUR_CONTEXT  # for example "dev"
    gcx resources push -p ./resources/