Skip to content

Commit

Permalink
Merge pull request #142 from consideRatio/pr/update-grafonnet
Browse files Browse the repository at this point in the history
Update grafonnet from v10.4.0 to v11.1.0, Grafana v11.1.0 is now required
  • Loading branch information
consideRatio authored Oct 7, 2024
2 parents 1f5fa1c + b8dc179 commit 2c14044
Show file tree
Hide file tree
Showing 459 changed files with 37,850 additions and 25,885 deletions.
2 changes: 1 addition & 1 deletion dashboards/activity.jsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S jsonnet -J ../vendor
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local ts = grafonnet.panel.timeSeries;
local prometheus = grafonnet.query.prometheus;
Expand Down
2 changes: 1 addition & 1 deletion dashboards/cluster.jsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S jsonnet -J ../vendor
// Deploys a dashboard showing cluster-wide information
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local ts = grafonnet.panel.timeSeries;
local barChart = grafonnet.panel.barChart;
Expand Down
12 changes: 6 additions & 6 deletions dashboards/common.libsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local ts = grafonnet.panel.timeSeries;
local barChart = grafonnet.panel.barChart;
local barGauge = grafonnet.panel.barGauge;
Expand All @@ -14,10 +14,10 @@ local var = grafonnet.dashboard.variable;
* - Y axes to start from 0 -- withMin(0)
* - Legend tooltip to show all values -- withTooltip({mode: 'multi'})
*
* ref: https://grafana.com/docs/grafana/v10.4/panels-visualizations/configure-panel-options/
* ref: https://grafana.com/docs/grafana/v11.1/panels-visualizations/configure-panel-options/
*/

// grafana ref: https://grafana.com/docs/grafana/v10.4/panels-visualizations/visualizations/time-series/
// grafana ref: https://grafana.com/docs/grafana/v11.1/panels-visualizations/visualizations/time-series/
// grafonnet ref: https://grafana.github.io/grafonnet/API/panel/timeSeries/index.html
tsOptions:
ts.standardOptions.withMin(0)
Expand All @@ -26,20 +26,20 @@ local var = grafonnet.dashboard.variable;
+ ts.fieldConfig.defaults.custom.withFillOpacity(10)
,

// grafana ref: https://grafana.com/docs/grafana/v10.4/panels-visualizations/visualizations/bar-chart/
// grafana ref: https://grafana.com/docs/grafana/v11.1/panels-visualizations/visualizations/bar-chart/
// grafonnet ref: https://grafana.github.io/grafonnet/API/panel/barChart/index.html
barChartOptions:
barChart.standardOptions.withMin(0)
+ barChart.options.withTooltip({ mode: 'multi' })
,

// grafana ref: https://grafana.com/docs/grafana/v10.4/panels-visualizations/visualizations/bar-gauge/
// grafana ref: https://grafana.com/docs/grafana/v11.1/panels-visualizations/visualizations/bar-gauge/
// grafonnet ref: https://grafana.github.io/grafonnet/API/panel/barGauge/index.html
barGaugeOptions:
barGauge.standardOptions.withMin(0)
,

// grafana ref: https://grafana.com/docs/grafana/v10.4/panels-visualizations/visualizations/heatmap/
// grafana ref: https://grafana.com/docs/grafana/v11.1/panels-visualizations/visualizations/heatmap/
// grafonnet ref: https://grafana.github.io/grafonnet/API/panel/heatmap/index.html
heatmapOptions:
heatmap.options.withCalculate(true)
Expand Down
2 changes: 1 addition & 1 deletion dashboards/homedirs.jsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S jsonnet -J ../vendor
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local prometheus = grafonnet.query.prometheus;
local table = grafonnet.panel.table;
Expand Down
8 changes: 4 additions & 4 deletions dashboards/jupyterhub.jsonnet
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S jsonnet -J ../vendor
// Deploys one dashboard - "JupyterHub dashboard",
// with useful stats about usage & diagnostics.
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local ts = grafonnet.panel.timeSeries;
local prometheus = grafonnet.query.prometheus;
Expand All @@ -16,7 +16,7 @@ local userMemoryDistribution =
common.heatmapOptions
+ heatmap.new('User memory usage distribution')
+ heatmap.options.yAxis.withUnit('bytes')
+ heatmap.options.color.HeatmapColorOptions.withScheme('Viridis')
+ heatmap.options.color.withScheme('Viridis')
+ heatmap.options.calculation.xBuckets.withMode('size')
+ heatmap.options.calculation.xBuckets.withValue('600s') // must align with interval
+ heatmap.queryOptions.withInterval('600s') // must align with xBuckets value
Expand All @@ -41,7 +41,7 @@ local userCPUDistribution =
common.heatmapOptions
+ heatmap.new('User CPU usage distribution')
+ heatmap.options.yAxis.withUnit('percentunit')
+ heatmap.options.color.HeatmapColorOptions.withScheme('Viridis')
+ heatmap.options.color.withScheme('Viridis')
+ heatmap.options.calculation.xBuckets.withMode('size')
+ heatmap.options.calculation.xBuckets.withValue('600s') // must align with interval
+ heatmap.queryOptions.withInterval('600s') // must align with xBuckets value
Expand All @@ -66,7 +66,7 @@ local userAgeDistribution =
common.heatmapOptions
+ heatmap.new('User active age distribution')
+ heatmap.options.yAxis.withUnit('s')
+ heatmap.options.color.HeatmapColorOptions.withScheme('Viridis')
+ heatmap.options.color.withScheme('Viridis')
+ heatmap.options.calculation.xBuckets.withMode('size')
+ heatmap.options.calculation.xBuckets.withValue('600s') // must align with interval
+ heatmap.queryOptions.withInterval('600s') // must align with xBuckets value
Expand Down
2 changes: 1 addition & 1 deletion dashboards/jupyterhub.libsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local ts = grafonnet.panel.timeSeries;
local prometheus = grafonnet.query.prometheus;

Expand Down
2 changes: 1 addition & 1 deletion dashboards/support.jsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S jsonnet -J ../vendor
// Deploys a dashboard showing information about support resources
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local ts = grafonnet.panel.timeSeries;
local prometheus = grafonnet.query.prometheus;
Expand Down
2 changes: 1 addition & 1 deletion dashboards/usage-report.jsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S jsonnet -J ../vendor
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local barGauge = grafonnet.panel.barGauge;
local prometheus = grafonnet.query.prometheus;
Expand Down
2 changes: 1 addition & 1 deletion dashboards/user.jsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S jsonnet -J ../vendor
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.4.0/main.libsonnet';
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local ts = grafonnet.panel.timeSeries;
local prometheus = grafonnet.query.prometheus;
Expand Down
12 changes: 9 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,15 @@ with `jsonnet`, you can deploy dashboards to a Grafana instance like this:

### Upgrading the grafonnet version

The grafonnet jsonnet library is bundled here with [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler).
Just running `jb update` in the git repo root dir after installing jsonnet-bunder should bring
you up to speed.
The grafonnet jsonnet library is bundled here with [jsonnet-bundler]. The
upgrade procedure looks looks like this:

1. Install jsonnet-bunder
2. Update `jsonnetfile.json` to reference the new version
3. Run `jb update` in the git repo root dir
4. Search and replace remaining old version references with the new version

[jsonnet-bundler]: https://github.com/jsonnet-bundler/jsonnet-bundler

### Metrics guidelines

Expand Down
5 changes: 3 additions & 2 deletions docs/tutorials/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Deploying the dashboards

```{warning}
ANY CHANGES YOU MAKE VIA THE GRAFANA UI WILL BE OVERWRITTEN NEXT TIME YOU RUN deploy.bash.
ANY CHANGES YOU MAKE VIA THE GRAFANA UI WILL BE OVERWRITTEN NEXT TIME YOU RUN `deploy.py`.
TO MAKE CHANGES, EDIT THE JSONNET FILE AND DEPLOY AGAIN
```

Expand Down Expand Up @@ -43,7 +43,8 @@ TO MAKE CHANGES, EDIT THE JSONNET FILE AND DEPLOY AGAIN
Make sure this is indented correctly where it should be!
```

4. A recent version of Grafana, with a prometheus data source already added.
4. A recent version of Grafana (v11.1.0 or higher), with a prometheus data
source already added.

5. An API key with 'admin' permissions. This is per-organization, and you can make a new one
by going to the configuration pane for your Grafana (the gear icon on the left bar), and
Expand Down
2 changes: 1 addition & 1 deletion jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": {
"git": {
"remote": "https://github.com/grafana/grafonnet.git",
"subdir": "gen/grafonnet-v10.4.0"
"subdir": "gen/grafonnet-v11.1.0"
}
},
"version": "main"
Expand Down
6 changes: 3 additions & 3 deletions jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"source": {
"git": {
"remote": "https://github.com/grafana/grafonnet.git",
"subdir": "gen/grafonnet-v10.4.0"
"subdir": "gen/grafonnet-v11.1.0"
}
},
"version": "6ac1593ca787638da223380ff4a3fd0f96e953e1",
"sum": "ZSmDT7i/qU9P8ggmuPuJT+jonq1ZEsBRCXycW/H5L/A=",
"version": "1ce5aec95ce32336fe47c8881361847c475b5254",
"sum": "41w7p/rwrNsITqNHMXtGSJAfAyKmnflg6rFhKBduUxM=",
"name": "grafonnet"
},
{
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2c14044

Please sign in to comment.