Skip to content

Commit e43bca4

Browse files
committed
use config prometheus for each provider
1 parent 54699a1 commit e43bca4

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

csp-mixin/azureconfig.libsonnet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@
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+
},
2230
},
2331
}

csp-mixin/gcpconfig.libsonnet

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,12 @@
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+
},
2229
},
2330
}

csp-mixin/main.libsonnet

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ 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-
},
2017
asMonitoringMixin(): {
2118
grafanaDashboards+:: this.grafana.dashboards,
22-
prometheusAlerts+:
23-
importRules(importstr 'alerts/azure-alerts.yml') + importRules(importstr 'alerts/gcp-alerts.yml'),
19+
prometheusAlerts+:: this.config.prometheus.alerts,
2420
},
2521
},
2622

0 commit comments

Comments
 (0)