-
Notifications
You must be signed in to change notification settings - Fork 0
/
overrides.libsonnet
44 lines (38 loc) · 1.79 KB
/
overrides.libsonnet
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
35
36
37
38
39
40
41
42
43
44
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
{
timeSeries: {
local timeSeries = g.panel.timeSeries,
colored(refId, color):
timeSeries.standardOptions.override.byQuery.new(refId)
+ timeSeries.standardOptions.override.byType.withPropertiesFromOptions(
timeSeries.standardOptions.color.withFixedColor(color)
+ timeSeries.standardOptions.color.withMode('fixed')
),
availableResource(refId):
timeSeries.standardOptions.override.byQuery.new(refId)
+ timeSeries.standardOptions.override.byType.withPropertiesFromOptions(
timeSeries.standardOptions.color.withFixedColor('light-green')
+ timeSeries.standardOptions.color.withMode('fixed')
+ timeSeries.fieldConfig.defaults.custom.withFillOpacity(20)
+ timeSeries.fieldConfig.defaults.custom.withLineWidth(0)
),
capacityLine(refId):
timeSeries.standardOptions.override.byQuery.new(refId)
+ timeSeries.standardOptions.override.byType.withPropertiesFromOptions(
timeSeries.standardOptions.color.withFixedColor('gray')
+ timeSeries.standardOptions.color.withMode('fixed')
+ timeSeries.fieldConfig.defaults.custom.withDrawStyle('line')
+ timeSeries.fieldConfig.defaults.custom.lineStyle.withDash([5, 10])
+ timeSeries.fieldConfig.defaults.custom.lineStyle.withFill('dash')
),
},
table: {
local table = g.panel.table,
gauge(fieldName):
table.standardOptions.override.byName.new(fieldName)
+ table.standardOptions.override.byName.withPropertiesFromOptions(
table.fieldConfig.defaults.custom.cellOptions.TableBarGaugeCellOptions.withMode('basic')
+ table.fieldConfig.defaults.custom.cellOptions.TableBarGaugeCellOptions.withType('gauge')
),
},
}