-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.jsonnet
34 lines (31 loc) · 973 Bytes
/
main.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local g = import 'g.libsonnet';
local row = g.panel.row;
local panels = import './panels.libsonnet';
local variables = import './variables.libsonnet';
local queries = import './queries.libsonnet';
g.dashboard.new('Basic Dashboard')
+ g.dashboard.withUid('basic-grafonnet-example')
+ g.dashboard.withDescription(|||
Dashboard generated with jsonnet
|||)
+ g.dashboard.withTimezone('browser')
+ g.dashboard.graphTooltip.withSharedCrosshair()
+ g.dashboard.withVariables([
variables.datasource,
variables.job,
])
+ g.dashboard.withPanels(
g.util.grid.makeGrid([
row.new('CPU and Memory')
+ row.withCollapsed(false)
+ row.withPanels([
panels.timeSeries.cpuUsage('CPU Usage', queries.cpuUsage),
panels.timeSeries.memoryUsage('Memory Usage', queries.memUsage),
]),
row.new('Load')
+ row.withCollapsed(false)
+ row.withPanels([
panels.timeSeries.short('Load Average', queries.loadUsage),
]),
], panelWidth=24)
)