Add Grafana dashboards as IaC (local + cloud) #26

Merged
AlexCaswen merged 26 commits from 27-grafana-dashboards-iac into main 2026-05-07 05:59:41 +00:00
AlexCaswen commented 2026-05-07 03:11:13 +00:00 (Migrated from gitlab.com)

What

Adds three official Grafana dashboards as Infrastructure-as-Code, deployed to both the local Grafana instance (10.121.25.33:3000) and Grafana Cloud (alexcaswen.grafana.net) from the same JSON source files.

Dashboards

Dashboard Source Grafana.com ID
Incus Official, by stgraber 19727
Erigon Official, from erigontech/erigon repo N/A (bundled in repo)
Bitcoin jvstein/bitcoin-prometheus-exporter 11274

Changes

versions.tf:

  • Add grafana/grafana provider (~> 3.0)
  • Two provider aliases: local (monitoring container) and cloud (Grafana Cloud)

grafana.tf:

  • Variables for auth tokens (GRAFANA_LOCAL_AUTH, GRAFANA_CLOUD_AUTH)
  • M3 Infrastructure folder created on both instances
  • 3 dashboards x 2 targets = 6 grafana_dashboard resources, all referencing the same JSON files

dashboards/*.json:

  • incus.json — official Incus dashboard (104KB)
  • erigon.json — official Erigon dashboard, sanitized to replace hardcoded datasource UID per erigontech/erigon#6994
  • bitcoin.json — Bitcoin exporter dashboard

Setup Required Before Merge

  1. Create a service account + token in local Grafana (10.121.25.33:3000)
  2. Create a service account + token in Grafana Cloud (alexcaswen.grafana.net)
  3. Add CI variables in GitLab:
    • GRAFANA_LOCAL_AUTH = local Grafana service account token
    • GRAFANA_CLOUD_AUTH = Grafana Cloud service account token
  4. Add -var="grafana_local_auth=$GRAFANA_LOCAL_AUTH" -var="grafana_cloud_auth=$GRAFANA_CLOUD_AUTH" to the tofu plan and tofu apply commands in .gitlab-ci.yml

Future

  • Alert rules as code via grafana_rule_group resources
  • Notification policies via grafana_notification_policy
  • Additional dashboards (system overview, trading engine) as new JSON files

Related: #27

## What Adds three official Grafana dashboards as Infrastructure-as-Code, deployed to both the local Grafana instance (`10.121.25.33:3000`) and Grafana Cloud (`alexcaswen.grafana.net`) from the same JSON source files. ## Dashboards | Dashboard | Source | Grafana.com ID | |---|---|---| | **Incus** | Official, by stgraber | [19727](https://grafana.com/grafana/dashboards/19727-incus/) | | **Erigon** | Official, from erigontech/erigon repo | N/A (bundled in repo) | | **Bitcoin** | jvstein/bitcoin-prometheus-exporter | [11274](https://grafana.com/grafana/dashboards/11274) | ## Changes **versions.tf:** - Add `grafana/grafana` provider (~> 3.0) - Two provider aliases: `local` (monitoring container) and `cloud` (Grafana Cloud) **grafana.tf:** - Variables for auth tokens (`GRAFANA_LOCAL_AUTH`, `GRAFANA_CLOUD_AUTH`) - `M3 Infrastructure` folder created on both instances - 3 dashboards x 2 targets = 6 `grafana_dashboard` resources, all referencing the same JSON files **dashboards/*.json:** - `incus.json` — official Incus dashboard (104KB) - `erigon.json` — official Erigon dashboard, sanitized to replace hardcoded datasource UID per [erigontech/erigon#6994](https://github.com/erigontech/erigon/issues/6994) - `bitcoin.json` — Bitcoin exporter dashboard ## Setup Required Before Merge 1. Create a service account + token in local Grafana (`10.121.25.33:3000`) 2. Create a service account + token in Grafana Cloud (`alexcaswen.grafana.net`) 3. Add CI variables in GitLab: - `GRAFANA_LOCAL_AUTH` = local Grafana service account token - `GRAFANA_CLOUD_AUTH` = Grafana Cloud service account token 4. Add `-var="grafana_local_auth=$GRAFANA_LOCAL_AUTH" -var="grafana_cloud_auth=$GRAFANA_CLOUD_AUTH"` to the `tofu plan` and `tofu apply` commands in `.gitlab-ci.yml` ## Future - Alert rules as code via `grafana_rule_group` resources - Notification policies via `grafana_notification_policy` - Additional dashboards (system overview, trading engine) as new JSON files Related: #27
AlexCaswen commented 2026-05-07 03:14:29 +00:00 (Migrated from gitlab.com)

added 1 commit

  • da183908 - Fix: add empty defaults to Grafana auth variables

Compare with previous version

added 1 commit <ul><li>da183908 - Fix: add empty defaults to Grafana auth variables</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1786918947&start_sha=eee130fdf1004571130fe68692ac2d9ef24e0117)
AlexCaswen commented 2026-05-07 03:18:10 +00:00 (Migrated from gitlab.com)

added 1 commit

  • e0a9761e - Fix variable description to match corrected Grafana IP

Compare with previous version

added 1 commit <ul><li>e0a9761e - Fix variable description to match corrected Grafana IP</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1786921683&start_sha=09aafdac0371cc7c32563573ac23e6705b15384c)
AlexCaswen commented 2026-05-07 05:08:43 +00:00 (Migrated from gitlab.com)

added 1 commit

  • b58b1b70 - Use uppercase variable names to match CI variable naming convention

Compare with previous version

added 1 commit <ul><li>b58b1b70 - Use uppercase variable names to match CI variable naming convention</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787012267&start_sha=e0a9761ef41627d1662ed78b13c39536d6d7365c)
AlexCaswen commented 2026-05-07 05:08:56 +00:00 (Migrated from gitlab.com)

added 1 commit

  • d8740a1e - Update provider blocks to reference uppercase variable names

Compare with previous version

added 1 commit <ul><li>d8740a1e - Update provider blocks to reference uppercase variable names</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787012491&start_sha=b58b1b701d19e62cac546dc3b5afc7ed500e353c)
AlexCaswen commented 2026-05-07 05:12:46 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 81c249db - Fix erigon dashboard: ASCII-safe UTF-8 encoding

Compare with previous version

added 1 commit <ul><li>81c249db - Fix erigon dashboard: ASCII-safe UTF-8 encoding</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787016529&start_sha=a4c614d16cf642b2e811fe0198d7ab86c4b8a1ce)
AlexCaswen commented 2026-05-07 05:12:56 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 77ca1190 - Fix incus dashboard: ASCII-safe UTF-8 encoding

Compare with previous version

added 1 commit <ul><li>77ca1190 - Fix incus dashboard: ASCII-safe UTF-8 encoding</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787016728&start_sha=81c249db1aca149096ff456e4be85a53a3b05aa0)
AlexCaswen commented 2026-05-07 05:14:21 +00:00 (Migrated from gitlab.com)

added 1 commit

  • a4c614d1 - Fix dashboard JSONs: ensure ASCII-safe UTF-8 encoding

Compare with previous version

added 1 commit <ul><li>a4c614d1 - Fix dashboard JSONs: ensure ASCII-safe UTF-8 encoding</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787018417&start_sha=d8740a1e31ba3e3b200ffec0fc20e0e2290f40f8)
AlexCaswen commented 2026-05-07 05:29:14 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 5094bec6 - Fetch dashboards from canonical sources instead of storing JSON

Compare with previous version

added 1 commit <ul><li>5094bec6 - Fetch dashboards from canonical sources instead of storing JSON</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787033888&start_sha=77ca119068a3a7557168397a497c0fd05e7a4821)
AlexCaswen commented 2026-05-07 05:29:23 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 20df5020 - Remove stored dashboard JSONs (now fetched at plan time)

Compare with previous version

added 1 commit <ul><li>20df5020 - Remove stored dashboard JSONs (now fetched at plan time)</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787034016&start_sha=5094bec69b3ac7f3e235343d0da134da12ceb202)
AlexCaswen commented 2026-05-07 05:29:31 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>e1735182 - Remove erigon dashboard JSON</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787034158&start_sha=20df5020f5d98405e41c1602499bdd8bbe75bcef)
AlexCaswen commented 2026-05-07 05:29:36 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>bac0f6dc - Remove incus dashboard JSON</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787034255&start_sha=e1735182497e4dba7c214513506fa2f51dfebbdb)
AlexCaswen commented 2026-05-07 05:29:58 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 0ee0567c - Add hashicorp/http provider for dashboard data sources

Compare with previous version

added 1 commit <ul><li>0ee0567c - Add hashicorp/http provider for dashboard data sources</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787034606&start_sha=bac0f6dc36f6bde1e4accff31b2208d09eee0eb7)
AlexCaswen commented 2026-05-07 05:38:27 +00:00 (Migrated from gitlab.com)

added 1 commit

  • cdef4468 - Revert to file() for dashboard JSONs

Compare with previous version

added 1 commit <ul><li>cdef4468 - Revert to file() for dashboard JSONs</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787042607&start_sha=0ee0567c35a698a01941ed4b3c1a5f3da22bf5bf)
AlexCaswen commented 2026-05-07 05:38:40 +00:00 (Migrated from gitlab.com)

added 1 commit

  • d3c05005 - Remove hashicorp/http provider (no longer needed)

Compare with previous version

added 1 commit <ul><li>d3c05005 - Remove hashicorp/http provider (no longer needed)</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787042804&start_sha=cdef4468e6ef7d75fb945984f523b953765a5d79)
AlexCaswen commented 2026-05-07 05:53:04 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>deb2222e - Add new directory</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787056391&start_sha=d3c05005510a1d9537830bd3e6a6798573c33928)
AlexCaswen commented 2026-05-07 05:54:19 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>503150c9 - Upload New File</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787057398&start_sha=deb2222eafae4716877a5a54619c2376bc7c1c50)
AlexCaswen commented 2026-05-07 05:55:27 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>2cae7021 - Edit 11274_revlatest.json</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787058402&start_sha=503150c9b962a390edb2e0e167cca2f71027fbe2)
AlexCaswen commented 2026-05-07 05:57:00 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>ab10cc7d - Upload New File</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787059748&start_sha=2cae7021a215ed37a860d6adc8c13011e91db416)
AlexCaswen commented 2026-05-07 05:57:50 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>4a81a697 - Edit 19727_revlatest.json</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787060633&start_sha=ab10cc7dc4eb78d2a18211b60367efb7ce4dc15b)
AlexCaswen commented 2026-05-07 05:58:50 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>9991fea4 - Upload New File</li></ul> [Compare with previous version](/AlexCaswen/m3-infra/-/merge_requests/26/diffs?diff_id=1787061620&start_sha=4a81a697cc8641a5fbeca1e70174bbdbef1c7138)
AlexCaswen commented 2026-05-07 05:59:41 +00:00 (Migrated from gitlab.com)

mentioned in commit aa7f1a93d5

mentioned in commit aa7f1a93d5dd2c74839d2813b899a24fb6bda820
AlexCaswen (Migrated from gitlab.com) merged commit aa7f1a93d5 into main 2026-05-07 05:59:41 +00:00
AlexCaswen commented 2026-05-07 06:06:32 +00:00 (Migrated from gitlab.com)

mentioned in merge request !27

mentioned in merge request !27
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midwitmoneymgmt/m3-infra!26
No description provided.