File tree Expand file tree Collapse file tree 9 files changed +28
-10
lines changed Expand file tree Collapse file tree 9 files changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111- Option to skip Prometheus job on static build
1212- Option to static build with custom set of sections
1313- Custom description and Grafana tags on manual build
14+ - API to build a dashboard from YAML config
1415
1516### Changed
1617- Display two digits after decimal point instead of three
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ POLICY ?= autogen
33MEASUREMENT ?= tarantool_http
44WITH_INSTANCE_VARIABLE ?= FALSE
55OUTPUT_STATIC_DASHBOARD ?= dashboard.json
6+ OUTPUT ?= dashboard.json
67TITLE ?=
78
89.PHONY : build-deps
@@ -12,6 +13,17 @@ build-deps:
1213 jb install
1314
1415
16+ .PHONY : build
17+ build :
18+ ifndef CONFIG
19+ @echo 1>&2 "CONFIG=config.yml must be set"
20+ false
21+ endif
22+ jsonnet -J ./vendor -J . \
23+ -e "local build = import 'dashboard/build/from_config.libsonnet'; local file = importstr '${CONFIG}'; build(std.parseYaml(file))" \
24+ -o ${OUTPUT}
25+
26+
1527_build-static-prometheus :
1628ifndef DATASOURCE
1729 @echo 1>&2 "DATASOURCE must be set"
File renamed without changes.
Original file line number Diff line number Diff line change 1+ local config = import 'dashboard/build/config.libsonnet' ;
2+ local dashboard = import 'dashboard/build/dashboard.libsonnet' ;
3+
4+ function (cfg)
5+ dashboard(config.prepare(cfg)).build()
Original file line number Diff line number Diff line change 11local config = import 'dashboard/build/config.libsonnet' ;
2- local dashboard_raw = import 'dashboard/build/dashboard_raw .libsonnet' ;
2+ local dashboard = import 'dashboard/build/dashboard .libsonnet' ;
33
44local DATASOURCE_TYPE = std.extVar('DATASOURCE_TYPE' );
55local DASHBOARD_TEMPLATE = std.extVar('DASHBOARD_TEMPLATE' );
@@ -90,4 +90,4 @@ local cfg =
9090 sections: sections,
9191 });
9292
93- dashboard_raw (cfg).build()
93+ dashboard (cfg).build()
Original file line number Diff line number Diff line change 11local config = import 'dashboard/build/config.libsonnet' ;
2- local dashboard_raw = import 'dashboard/build/dashboard_raw .libsonnet' ;
2+ local dashboard = import 'dashboard/build/dashboard .libsonnet' ;
33local variable = import 'dashboard/variable.libsonnet' ;
44
55local cfg = config.prepare({
@@ -29,4 +29,4 @@ local cfg = config.prepare({
2929 ],
3030});
3131
32- dashboard_raw (cfg)
32+ dashboard (cfg)
Original file line number Diff line number Diff line change 11local config = import 'dashboard/build/config.libsonnet' ;
2- local dashboard_raw = import 'dashboard/build/dashboard_raw .libsonnet' ;
2+ local dashboard = import 'dashboard/build/dashboard .libsonnet' ;
33local variable = import 'dashboard/variable.libsonnet' ;
44
55local cfg = config.prepare({
@@ -38,4 +38,4 @@ local cfg = config.prepare({
3838 ],
3939});
4040
41- dashboard_raw (cfg)
41+ dashboard (cfg)
Original file line number Diff line number Diff line change 11local config = import 'dashboard/build/config.libsonnet' ;
2- local dashboard_raw = import 'dashboard/build/dashboard_raw .libsonnet' ;
2+ local dashboard = import 'dashboard/build/dashboard .libsonnet' ;
33local variable = import 'dashboard/variable.libsonnet' ;
44
55local cfg = config.prepare({
@@ -27,4 +27,4 @@ local cfg = config.prepare({
2727 ],
2828});
2929
30- dashboard_raw (cfg)
30+ dashboard (cfg)
Original file line number Diff line number Diff line change 11local config = import 'dashboard/build/config.libsonnet' ;
2- local dashboard_raw = import 'dashboard/build/dashboard_raw .libsonnet' ;
2+ local dashboard = import 'dashboard/build/dashboard .libsonnet' ;
33local variable = import 'dashboard/variable.libsonnet' ;
44
55local cfg = config.prepare({
@@ -36,4 +36,4 @@ local cfg = config.prepare({
3636 ],
3737});
3838
39- dashboard_raw (cfg)
39+ dashboard (cfg)
You can’t perform that action at this time.
0 commit comments