From 782fe845f422b47090c8babd673fab7c6443b6b5 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 30 May 2023 12:51:16 +0200 Subject: [PATCH 1/2] Update instructions on how to contribute to dashboards --- CONTRIBUTING.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ce8a811b28..149b4d5ba8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -189,10 +189,25 @@ To edit or extend an existing Grafana dashboard with minimal diff: 1. Grab the .json dashboard file from current unstable 2. Import file to Grafana via the web UI at `/dashboard/import`. Give it some temporal name relevant to your work (i.e. the branch name) -3. Do edits on the Dashboard +3. Visually edit the dashboard 4. Once done make sure to leave the exact same visual aspect as before: same refresh interval, collapsed rows, etc. -5. Click the "share dashboard" icon next to the title at the top left corner. Go to the "Export" tab, set "Export for sharing externally" to true and click "Save to file" -6. Paste the contents of the downloaded file in the Github repo, commit and open your PR +5. Run download script, see [below](#using-download-script) on how to use it +6. Check git diff of updated dashboards, commit, push and open your PR + +### Using Download Script + +Create a file `.secrets.env` with envs + +```sh +GRAFANA_API_KEY=$token +GRAFANA_URL=https://yourgrafanaapi.io +``` + +Run script to download dashboards to `./dashboards` folder + +```sh +node scripts/download_dashboards.mjs +``` ## Label Guide From 5197f697309075bbaf2ff8abeb67b77725140381 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 30 May 2023 13:09:42 +0200 Subject: [PATCH 2/2] Dashboard must be saved before downloading --- CONTRIBUTING.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 149b4d5ba8e..2890d126d56 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -191,8 +191,9 @@ To edit or extend an existing Grafana dashboard with minimal diff: 2. Import file to Grafana via the web UI at `/dashboard/import`. Give it some temporal name relevant to your work (i.e. the branch name) 3. Visually edit the dashboard 4. Once done make sure to leave the exact same visual aspect as before: same refresh interval, collapsed rows, etc. -5. Run download script, see [below](#using-download-script) on how to use it -6. Check git diff of updated dashboards, commit, push and open your PR +5. Save the dashboard (CTRL + S) +6. Run download script, see [below](#using-download-script) on how to use it +7. Check git diff of updated dashboards, commit, push and open your PR ### Using Download Script