-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathmain.libsonnet
53 lines (46 loc) · 1.48 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
46
47
48
49
50
51
52
53
local alerts = import './alerts.libsonnet';
local annotations = import './annotations.libsonnet';
local config = import './config.libsonnet';
local dashboards = import './dashboards.libsonnet';
local datasources = import './datasources.libsonnet';
local g = import './g.libsonnet';
local links = import './links.libsonnet';
local panels = import './panels.libsonnet';
local rows = import './rows.libsonnet';
local signals = import './signals.libsonnet';
local variables = import './variables.libsonnet';
local commonlib = import 'common-lib/common/main.libsonnet';
{
withConfigMixin(config): {
config+: config,
},
new(): {
local this = self,
config: config,
signals: signals.new(this),
grafana: {
variables: commonlib.variables.new(
filteringSelector=this.config.filteringSelector,
groupLabels=this.config.groupLabels,
instanceLabels=this.config.instanceLabels,
varMetric='up',
enableLokiLogs=this.config.enableLokiLogs,
),
annotations: annotations.new(this),
links: links.new(this),
panels: panels.new(this),
rows: rows.new(this.grafana.panels),
dashboards: dashboards.new(this),
},
prometheus: {
alerts: alerts.new(this),
recordingRules: {},
},
asMonitoringMixin(): {
// _config+:: this.config,
grafanaDashboards+:: this.grafana.dashboards,
prometheusAlerts+:: this.prometheus.alerts,
prometheusRules+:: this.prometheus.recordingRules,
},
},
}