Skip to content

Commit 54699a1

Browse files
committed
importRules directly on mixing
1 parent c248749 commit 54699a1

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

csp-mixin/azureconfig.libsonnet

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,5 @@
1919
groupLabels: ['job', 'resourceGroup', 'subscriptionName'],
2020
instanceLabels: ['resourceName'],
2121
metricsSource: 'azuremonitor',
22-
23-
local importRules(rules) = {
24-
groups+: std.parseYaml(rules).groups,
25-
},
26-
27-
prometheus: {
28-
alerts: importRules(importstr 'alerts/azure-alerts.yml'),
29-
recordingRules: {},
30-
},
3122
},
3223
}

csp-mixin/gcpconfig.libsonnet

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,5 @@
1919
groupLabels: ['job'],
2020
instanceLabels: ['bucket_name'],
2121
metricsSource: 'stackdriver',
22-
local importRules(rules) = {
23-
groups+: std.parseYaml(rules).groups,
24-
},
25-
26-
prometheus: {
27-
alerts: importRules(importstr 'alerts/gcp-alerts.yml'),
28-
recordingRules: {},
29-
},
3022
},
3123
}

csp-mixin/main.libsonnet

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ local commonlib = import 'common-lib/common/main.libsonnet';
1414
rows: (import './rows.libsonnet').new(this),
1515
dashboards: (import './dashboards.libsonnet').new(this),
1616
},
17+
local importRules(rules) = {
18+
groups+: std.parseYaml(rules).groups,
19+
},
1720
asMonitoringMixin(): {
1821
grafanaDashboards+:: this.grafana.dashboards,
19-
prometheusAlerts+:: this.prometheus.alerts,
22+
prometheusAlerts+:
23+
importRules(importstr 'alerts/azure-alerts.yml') + importRules(importstr 'alerts/gcp-alerts.yml'),
2024
},
2125
},
2226

0 commit comments

Comments
 (0)