Skip to content

Commit

Permalink
observability: implement better/fully working grafana sync (aptos-lab…
Browse files Browse the repository at this point in the history
…s#5064)

The previous grafana sync method had a few bugs and didn't sync/support certain constructs and led broken dashboards - this was likely due to the Go grafana-sync tool using a kinda old Grafana SDK version and relying on Go structs having implemented every single possible field.

With the new sync method we're using the API directly and treating the dashboard more-or-less as a blob so it should work mostly fine, even when grafana adds new properties/features in the serialization format.

Also adding a method to sync dashboards back from local to Grafana which wasn't really supported before.

Lastly this also auto deletes dashboards that don't exist in Grafana anymore.
  • Loading branch information
geekflyer authored Oct 15, 2022
1 parent 7f8b700 commit 0f60beb
Show file tree
Hide file tree
Showing 67 changed files with 27,282 additions and 35,626 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/grafana-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # pin@v3
- name: Pull and sync Grafana dashboards
run: ./scripts/sync_grafana_dashboards.sh
- uses: pnpm/action-setup@537643d491d20c2712d11533497cb47b2d0eb9d5 # pin https://github.com/pnpm/action-setup/releases/tag/v2.2.3
with:
version: 7.13.4
run_install: |
- recursive: false
args: [--frozen-lockfile]
- name: Download current Grafana dashboards
run: pnpm exec scripts/grafana-sync.mts download
- name: Create Pull Request
uses: peter-evans/create-pull-request@671dc9c9e0c2d73f07fa45a3eb0220e1622f0c5f # pin@v4
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,5 @@ node_modules
# Cached python files
__pycache__

# Grafana sync
grafana-sync*

# ignore framework release bundle file
**/*.mrb
Loading

0 comments on commit 0f60beb

Please sign in to comment.