From f87b3d47801ea6a96d63d7afec504bb27fba53ed Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 21 Oct 2024 16:37:38 +0200 Subject: [PATCH] Add readme to grafana-dashboards dir --- grafana-dashboards/README.md | 21 +++++++++++++++++++++ grafana-dashboards/cloud-cost-aws.jsonnet | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 grafana-dashboards/README.md diff --git a/grafana-dashboards/README.md b/grafana-dashboards/README.md new file mode 100644 index 000000000..05f2c5b5b --- /dev/null +++ b/grafana-dashboards/README.md @@ -0,0 +1,21 @@ +# About these grafana dashboard files + +These are dashboard definitions as jsonnet templates. They are deployed using a +Python script from https://github.com/jupyterhub/grafana-dashboard, which can be +done via the deployer command: + +```bash +deployer grafana deploy-dashboards $CLUSTER_NAME +``` + +Running this command has a pre-requisite that you have jsonnet installed, +specifically the jsonnet binary built using golang called go-jsonnet. + +To just render the jsonnet templates, which is relevant during development, you +can: + +1. Clone https://github.com/jupyterhub/grafana-dashboard somewhere +2. Go to that folder, and then run something like: + ```bash + jsonnet -J vendor /some/path/2i2c-org/infrastructure/grafana-dashboards/cloud-cost-aws.jsonnet + ``` diff --git a/grafana-dashboards/cloud-cost-aws.jsonnet b/grafana-dashboards/cloud-cost-aws.jsonnet index 0b23e8445..7fd5dd170 100644 --- a/grafana-dashboards/cloud-cost-aws.jsonnet +++ b/grafana-dashboards/cloud-cost-aws.jsonnet @@ -93,6 +93,11 @@ local totalDailyCostsPerComponentAndHub = // grafonnet ref: https://grafana.github.io/grafonnet/API/dashboard/index.html +// +// A dashboard description can be provided, but isn't used much it seems, due to +// that we aren't providing one atm. +// See https://community.grafana.com/t/dashboard-description-is-it-used-anywhere/53273. +// dashboard.new("Cloud cost attribution") + dashboard.withUid("cloud-cost-aws") + dashboard.withTimezone("utc")