-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy pathmain.libsonnet
45 lines (44 loc) · 1.38 KB
/
main.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
45
local g = import './g.libsonnet';
local commonlib = import 'common-lib/common/main.libsonnet';
{
new(): {
local this = self,
config: (import './config.libsonnet')._config,
signals:
{
container: commonlib.signals.unmarshallJsonMulti(
this.config.signals.container, type=this.config.metricsSource
),
machine: commonlib.signals.unmarshallJsonMulti(
this.config.signals.machine, type=this.config.metricsSource
),
},
grafana: {
panels: (import './panels.libsonnet').new(this),
rows: (import './rows.libsonnet').new(this),
dashboards: (import './dashboards.libsonnet').new(this),
// common links here
links: {
local link = g.dashboard.link,
otherDashboards:
link.dashboards.new('All Docker dashboards', this.config.dashboardTags)
+ link.dashboards.options.withIncludeVars(true)
+ link.dashboards.options.withKeepTime(true)
+ link.dashboards.options.withAsDropdown(false),
},
},
prometheus: {
alerts: {},
recordingRules: {},
},
asMonitoringMixin(): {
// _config+:: this.config,
grafanaDashboards+:: this.grafana.dashboards,
prometheusAlerts+:: this.prometheus.alerts,
prometheusRules+:: this.prometheus.recordingRules,
},
},
withConfigMixin(config): {
config+: config,
},
}