-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.libsonnet
55 lines (45 loc) · 1.81 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
55
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
local annotation = g.dashboard.annotation;
{
_config+:: {
// Bypasses grafana.com/dashboards validator
bypassDashboardValidation: {
__inputs: [],
__requires: [],
},
djangoSelector: 'job=~"django"',
grafanaUrl: 'https://grafana.com',
overviewDashboardUid: 'django-overview-jkwq',
requestsOverviewDashboardUid: 'django-requests-jkwq',
requestsByViewDashboardUid: 'django-requests-by-view-jkwq',
overviewDashboardUrl: '%s/d/%s/django-overview' % [self.grafanaUrl, self.overviewDashboardUid],
requestsByViewDashboardUrl: '%s/d/%s/django-requests-by-view' % [self.grafanaUrl, self.requestsByViewDashboardUid],
tags: ['django', 'django-mixin'],
adminViewRegex: 'admin.*',
djangoIgnoredViews: '<unnamed view>|health_check:health_check_home|prometheus-django-metrics',
djangoIgnoredTemplates: ".*'health_check/index.html'.*|None",
django4xxSeverity: 'warning',
django4xxInterval: '5m',
django4xxThreshold: '5', // percent
django5xxSeverity: 'warning',
django5xxInterval: '5m',
django5xxThreshold: '5', // percent
// 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 {},
},
}