File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -118,4 +118,22 @@ local g = import 'grafana-builder/grafana.libsonnet';
118
118
for matcher in std.filter (function (matcher) matcher.op != 'nop' , selector)
119
119
];
120
120
'{%s}' % std.join (', ' , pairs),
121
+
122
+ // withRunbookURL - Add/Override the runbook_url annotations for all alerts inside a list of rule groups.
123
+ // - url_format: an URL format for the runbook, the alert name will be substituted in the URL.
124
+ // - groups: the list of rule groups containing alerts.
125
+ withRunbookURL(url_format, groups)::
126
+ [
127
+ group {
128
+ rules: [
129
+ alert {
130
+ annotations+: {
131
+ runbook_url: url_format % alert.alert,
132
+ },
133
+ }
134
+ for alert in group.rules
135
+ ],
136
+ }
137
+ for group in groups
138
+ ],
121
139
}
You can’t perform that action at this time.
0 commit comments