-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.libsonnet
54 lines (46 loc) · 1.61 KB
/
config.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
54
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
local annotation = g.dashboard.annotation;
{
_config+:: {
local this = self,
// Bypasses grafana.com/dashboards validator
bypassDashboardValidation: {
__inputs: [],
__requires: [],
},
openCostSelector: 'job=~"opencost"',
grafanaUrl: 'https://grafana.com',
openCostOverviewDashboardUid: 'opencost-mixin-kover-jkwq',
openCostOverviewDashboardUrl: '%s/d/%s/opencost-overview' % [this.grafanaUrl, this.openCostOverviewDashboardUid],
openCostNamespaceDashboardUid: 'opencost-mixin-namespace-jkwq',
openCostNamespaceDashboardUrl: '%s/d/%s/opencost-namespace' % [this.grafanaUrl, this.openCostNamespaceDashboardUid],
alerts: {
budget: {
enabled: true,
monthlyCostThreshold: 200,
},
anomaly: {
enabled: true,
anomalyPercentageThreshold: 20,
},
},
tags: ['opencost', 'opencost-mixin'],
// Custom annotations to display in graphs
annotation: {
enabled: false,
name: 'Custom Annotation',
datasource: '-- Grafana --',
iconColor: 'green',
tags: [],
},
customAnnotation:: if $._config.annotation.enabled then
annotation.withName($._config.annotation.name) +
annotation.withIconColor($._config.annotation.iconColor) +
annotation.withHide(false) +
annotation.datasource.withUid($._config.annotation.datasource) +
annotation.target.withMatchAny(true) +
annotation.target.withTags($._config.annotation.tags) +
annotation.target.withType('tags')
else {},
},
}