diff --git a/grafana-dashboards/common.jsonnet b/grafana-dashboards/common.jsonnet new file mode 100644 index 0000000000..18f6d14316 --- /dev/null +++ b/grafana-dashboards/common.jsonnet @@ -0,0 +1,17 @@ +local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v11.1.0/main.libsonnet'; +local var = grafonnet.dashboard.variable; + +{ + // grafonnet ref: https://grafana.github.io/grafonnet/API/dashboard/variable.html + variables: { + datasource: + var.datasource.new('datasource', 'yesoreyeram-infinity-datasource') + + var.datasource.generalOptions.showOnDashboard.withNothing() + , + newhub: + var.query.new('hub') + + var.query.withDatasourceFromVariable(self.datasource) + + var.query.selectionOptions.withIncludeAll(value=true) + , + }, +}