-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathmain.libsonnet
More file actions
62 lines (56 loc) · 1.92 KB
/
main.libsonnet
File metadata and controls
62 lines (56 loc) · 1.92 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
local alerts = import './alerts.libsonnet';
local config = import './config.libsonnet';
local dashboards = import './dashboards.libsonnet';
local datasources = import './datasources.libsonnet';
local g = import './g.libsonnet';
local panels = import './panels.libsonnet';
local targets = import './targets.libsonnet';
local commonlib = import 'common-lib/common/main.libsonnet';
{
new(): {
local this = self,
config: config,
signals:
{
[sig]: commonlib.signals.unmarshallJsonMulti(
this.config.signals[sig],
type=this.config.metricsSource
)
for sig in std.objectFields(this.config.signals)
},
grafana: {
variables: commonlib.variables.new(
filteringSelector=this.config.filteringSelector,
groupLabels=this.config.groupLabels,
instanceLabels=this.config.instanceLabels,
varMetric='windows_os_info',
customAllValue='.+',
enableLokiLogs=this.config.enableLokiLogs,
),
annotations: (import './annotations.libsonnet').new(this),
links: {
local link = g.dashboard.link,
backToFleet:
link.link.new('Back to Windows fleet', '/d/' + this.grafana.dashboards.fleet.uid)
+ link.link.options.withKeepTime(true),
backToOverview:
link.link.new('Back to Windows overview', '/d/' + this.grafana.dashboards.overview.uid)
+ link.link.options.withKeepTime(true),
otherDashboards:
link.dashboards.new('All Windows dashboards', this.config.dashboardTags)
+ link.dashboards.options.withIncludeVars(true)
+ link.dashboards.options.withKeepTime(true)
+ link.dashboards.options.withAsDropdown(true),
},
panels: panels.new(this),
dashboards: dashboards.new(this),
},
prometheus: {
alerts: alerts.new(this),
recordingRules: {},
},
},
withConfigMixin(config): {
config+: config,
},
}