-
Notifications
You must be signed in to change notification settings - Fork 163
/
main.libsonnet
42 lines (34 loc) · 1.05 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
local alerts = import './alerts.libsonnet';
local config = import './config.libsonnet';
local dashboards = import './dashboards.libsonnet';
local g = import './g.libsonnet';
local panels = import './panels.libsonnet';
local rows = import './rows.libsonnet';
local commonlib = import 'common-lib/common/main.libsonnet';
{
withConfigMixin(config): {
config+: config,
},
new(): {
local this = self,
config: config,
signals: commonlib.signals.unmarshallJsonMulti(this.config.signals, type=this.config.metricsSource),
grafana: {
annotations: {},
links: {},
panels: panels.new(this.signals),
dashboards: dashboards.new(this),
rows: rows.new(this.grafana.panels, type=this.config.metricsSource),
},
prometheus: {
alerts: alerts.new(this),
recordingRules: {},
},
asMonitoringMixin(): {
// _config+:: this.config,
grafanaDashboards+:: this.grafana.dashboards,
prometheusAlerts+:: this.prometheus.alerts,
prometheusRules+:: this.prometheus.recordingRules,
},
},
}