forked from grafana/jsonnet-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathannotations.libsonnet
More file actions
37 lines (35 loc) · 1.33 KB
/
Copy pathannotations.libsonnet
File metadata and controls
37 lines (35 loc) · 1.33 KB
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
local g = import './g.libsonnet';
local commonlib = import 'common-lib/common/main.libsonnet';
{
new(this):
{
critical: commonlib.annotations.fatal.new(
title='Critical alert',
target=this.signals.alerts.alertsCritical.asTarget(),
)
{ textFormat: '{{alertname}}' }
+ commonlib.annotations.base.withTagKeys(std.join(',', this.config.groupLabels + this.config.instanceLabels)),
warning: commonlib.annotations.base.new(
title='Warning alert',
target=this.signals.alerts.alertsWarning.asTarget(),
)
{
textFormat: '{{alertname}}',
hide: true,
}
+ commonlib.annotations.base.withTagKeys(std.join(',', this.config.groupLabels + this.config.instanceLabels)),
}
+
if
this.config.enableLokiLogs
then
{
criticalEvents: commonlib.annotations.fatal.new(
title='Critical event logged',
target=this.signals.logs.criticalLogs.asTarget()
)
+ commonlib.annotations.base.withTagKeys(std.join(',', this.config.groupLabels + this.config.instanceLabels + this.config.extraLogLabels)),
}
else
{},
}